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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 19 Jul 2013 15:55:52 +0200
From:	Jiri Pirko <jiri@...nulli.us>
To:	netdev@...r.kernel.org
Cc:	davem@...emloft.net, stephen@...workplumber.org,
	Narendra_K@...l.com, bhutchings@...arflare.com,
	john.r.fastabend@...el.com
Subject: [patch iproute2] ip: show physical port id

Signed-off-by: Jiri Pirko <jiri@...nulli.us>
---
 include/linux/if_link.h |  1 +
 ip/ipaddress.c          | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 965dc9f..ea0d5b7 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -143,6 +143,7 @@ enum {
 	IFLA_NUM_TX_QUEUES,
 	IFLA_NUM_RX_QUEUES,
 	IFLA_CARRIER,
+	IFLA_PHYS_PORT_ID,
 	__IFLA_MAX
 };
 
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 5b9a438..0c7c55b 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -429,6 +429,16 @@ 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_PORT_ID]) {
+		int i;
+		unsigned char *buf = RTA_DATA(tb[IFLA_PHYS_PORT_ID]);
+		unsigned char len = RTA_PAYLOAD(tb[IFLA_PHYS_PORT_ID]);
+
+		fprintf(fp, "phys_port_id ");
+		for (i = 0; i < len; i++)
+			fprintf(fp, "%02x", buf[i]);
+		fprintf(fp, " ");
+	}
 	if (tb[IFLA_OPERSTATE])
 		print_operstate(fp, rta_getattr_u8(tb[IFLA_OPERSTATE]));
 
-- 
1.8.1.4

--
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