Subject: [PATCH] Fix IB network discovery from switch node.

Signed-off-by: Eli Dorfman <[email protected]>
---
 infiniband-diags/libibnetdisc/src/ibnetdisc.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c 
b/infiniband-diags/libibnetdisc/src/ibnetdisc.c
index c69467e..779e659 100644
--- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c
+++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c
@@ -590,13 +590,15 @@ ibnd_fabric_t *ibnd_discover_fabric(struct ibmad_port * 
ibmad_port,
        if (!port)
                goto error;
 
-       rc = get_remote_node(ibmad_port, fabric, node, port, from,
-                            mad_get_field(node->info, 0,
-                                          IB_NODE_LOCAL_PORT_F), 0);
-       if (rc < 0)
-               goto error;
-       if (rc > 0)             /* non-fatal error, nothing more to be done */
-               return ((ibnd_fabric_t *) fabric);
+       if (node->node.type != IB_NODE_SWITCH) { 
+               rc = get_remote_node(ibmad_port, fabric, node, port, from,
+                                    mad_get_field(node->info, 0,
+                                                  IB_NODE_LOCAL_PORT_F), 0);
+               if (rc < 0)
+                       goto error;
+               if (rc > 0)             /* non-fatal error, nothing more to be 
done */
+                       return ((ibnd_fabric_t *) fabric);
+       }
 
        for (dist = 0; dist <= max_hops; dist++) {
 
-- 
1.5.5

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to