lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1417802537-20020-1-git-send-email-gospo@cumulusnetworks.com>
Date:	Fri,  5 Dec 2014 13:02:15 -0500
From:	Andy Gospodarek <gospo@...ulusnetworks.com>
To:	netdev@...r.kernel.org
Cc:	sfeldma@...il.com, jpirko@...nulli.us
Subject: [PATCH iproute2 1/3] ip-link: display parentid for netdevs

Display parentid for netdev that may actually be associated with device
capable of offloading network forwarding.  Useful to identify which
netdevs are connected device when multiple forwarding elements are on a
system.

Based on patch from Jiri Pirko but with a different name for netlink
attribute.

Signed-off-by: Andy Gospodarek <gospo@...ulusnetworks.com>
---

I did not include definition for IFLA_PHYS_PARENT_ID as Stephen
indicated that patching if_link.h isn't needed since it will get pulled
later.

 ip/ipaddress.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 4d99324..d155085 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -581,6 +581,14 @@ int print_linkinfo(const struct sockaddr_nl *who,
 		fprintf(fp, "master %s ", ll_idx_n2a(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1));
 	}
 
+	if (tb[IFLA_PHYS_PARENT_ID]) {
+		SPRINT_BUF(b1);
+		fprintf(fp, "parentid %s ",
+			hexstring_n2a(RTA_DATA(tb[IFLA_PHYS_PARENT_ID]),
+				      RTA_PAYLOAD(tb[IFLA_PHYS_PARENT_ID]),
+				      b1, sizeof(b1)));
+	}
+
 	if (tb[IFLA_PHYS_PORT_ID]) {
 		SPRINT_BUF(b1);
 		fprintf(fp, "portid %s ",
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ