]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
ibacm: Automatically select local port if not specified by path record
authorSean Hefty <sean.hefty@intel.com>
Mon, 4 Jun 2012 18:38:54 +0000 (11:38 -0700)
committerSean Hefty <sean.hefty@intel.com>
Mon, 4 Jun 2012 18:38:54 +0000 (11:38 -0700)
If the user specifies a DLID or DGID as part of a path record lookup,
automatically select a local port.  This allows a user to query an SA
without needing to specify the local SLID or SGID.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/acm.c

index c940df3ab60338b168ca26b44027165ee53c78d9..7891788c11090c238ab224cce3d735c6814762e1 100644 (file)
--- a/src/acm.c
+++ b/src/acm.c
@@ -1762,6 +1762,10 @@ acm_is_path_from_port(struct acm_port *port, struct ibv_path_record *path)
                return (port->lid == (ntohs(path->slid) & port->lid_mask));
        }
 
+       if (ib_any_gid(&path->dgid)) {
+               return 1;
+       }
+
        if (acm_gid_index(port, &path->dgid) < port->gid_cnt) {
                return 1;
        }