[PATCH v3 4/4] ibacm: Use alias name when possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When using ipoib child interfaces, the names displayed by the ip
utility show:

 # ip addr show | grep inet' ' | grep ib
    inet 192.168.200.201/24 scope global stib1
    inet 192.168.200.200/24 scope global secondary stib1:P03

However, the logging of ibacm uses the device names (slightly edited
for better brevity):

 # grep acm_ep_ip_iter_cb /usr/local/var/log/ibacm.log
Added 192.168.200.201/24 mlx4_0 2 0x84b4 from stib1
Added 192.168.200.200/24 mlx4_0 2 0x84b4 from stib1

This commit changes this by using the alias name when possible, and
the above would read:

 # grep acm_ep_ip_iter_cb /usr/local/var/log/ibacm.log
Added 192.168.200.201/24 mlx4_0 2 0x84b4 from stib1
Added 192.168.200.200/24 mlx4_0 2 0x84b4 from stib1:P03

Signed-off-by: Håkon Bugge <haakon.bugge@xxxxxxxxxx>
Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>

---

v1 -> v2:
   * Added Ira's r-b
   * Removed Gerrit's Change-Id tag (Håkon)
---
 ibacm/src/acm_util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ibacm/src/acm_util.c b/ibacm/src/acm_util.c
index 8807579d..828501df 100644
--- a/ibacm/src/acm_util.c
+++ b/ibacm/src/acm_util.c
@@ -216,7 +216,8 @@ static void acm_if_iter(struct nl_object *obj, void *_ctx_and_cb)
 		be64toh(sgid.global.interface_id));
 
 	memcpy(&bin_addr, nl_addr_get_binary_addr(a), addr_len);
-	ctx_cb->cb(rtnl_link_get_name(link), &sgid, pkey, af2acm_addr_type(af), bin_addr, ip_str, ctx_cb->ctx);
+	ctx_cb->cb(label ? label : rtnl_link_get_name(link),
+		   &sgid, pkey, af2acm_addr_type(af), bin_addr, ip_str, ctx_cb->ctx);
 }
 
 
-- 
2.20.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux