]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
ibacm: Fix handling of aliased IPoIB devices
authorIra Weiny <ira.weiny@intel.com>
Tue, 25 Mar 2014 23:21:46 +0000 (19:21 -0400)
committerSean Hefty <sean.hefty@intel.com>
Tue, 8 Apr 2014 21:15:53 +0000 (14:15 -0700)
ibX:Y devices don't have sysfs files directly.  They use the "base" interface
of ibX.  The ioctl calls however include the full aliased name.

Netlink does not have this problem as the interface name is reported as it
appears in sysfs.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/acm_util.c

index c3c5b69b3ce4b8a3563e461a9ac497e100491654..da6d058965c0ea82fe3b66381bbae087c7b39e08 100644 (file)
@@ -134,6 +134,7 @@ int acm_if_iter_sys(acm_if_iter_cb cb, void *ctx)
        uint8_t addr_type;
        uint8_t addr[ACM_MAX_ADDRESS];
        size_t addr_len;
+       char *alias_sep;
 
        s = socket(AF_INET6, SOCK_DGRAM, 0);
        if (!s)
@@ -177,6 +178,12 @@ int acm_if_iter_sys(acm_if_iter_cb cb, void *ctx)
                        continue;
                }
 
+               acm_log(2, "%s\n", ifr[i].ifr_name);
+
+               alias_sep = strchr(ifr[i].ifr_name, ':');
+               if (alias_sep)
+                       *alias_sep = '\0';
+
                if (!acm_if_is_ib(ifr[i].ifr_name))
                        continue;