netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support
@ 2018-05-31 14:28 Nicolas Dichtel
  2018-05-31 14:31 ` Nicolas Dichtel
  2018-05-31 15:46 ` Stephen Hemminger
  0 siblings, 2 replies; 16+ messages in thread
From: Nicolas Dichtel @ 2018-05-31 14:28 UTC (permalink / raw)
  To: shemminger; +Cc: netdev, Nicolas Dichtel

Parse and display those attributes.
Example:
ip l a type dummy
ip netns add foo
ip monitor link&
ip l s dummy1 netns foo
Deleted 6: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default
    link/ether 66:af:3a:3f:a0:89 brd ff:ff:ff:ff:ff:ff new-nsid 0 new-ifindex 6

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 ip/ipaddress.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 00da14c6f97c..c7c7e7df4e81 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -964,6 +964,17 @@ int print_linkinfo(const struct sockaddr_nl *who,
 		}
 	}
 
+	if (tb[IFLA_NEW_NETNSID]) {
+		int id = rta_getattr_u32(tb[IFLA_NEW_NETNSID]);
+
+		print_int(PRINT_FP, NULL, " new-nsid %d", id);
+	}
+	if (tb[IFLA_NEW_IFINDEX]) {
+		int id = rta_getattr_u32(tb[IFLA_NEW_IFINDEX]);
+
+		print_int(PRINT_FP, NULL, " new-ifindex %d", id);
+	}
+
 	if (tb[IFLA_PROTO_DOWN]) {
 		if (rta_getattr_u8(tb[IFLA_PROTO_DOWN]))
 			print_bool(PRINT_ANY,
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-06-08 17:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 14:28 [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support Nicolas Dichtel
2018-05-31 14:31 ` Nicolas Dichtel
2018-05-31 15:46 ` Stephen Hemminger
2018-05-31 15:51   ` Nicolas Dichtel
2018-06-01 15:02     ` Nicolas Dichtel
2018-06-01 20:02       ` Stephen Hemminger
2018-06-04 12:12   ` [PATCH iproute2 0/2] display netns name instead of nsid Nicolas Dichtel
2018-06-04 12:12     ` [PATCH iproute2 1/2] ip: " Nicolas Dichtel
2018-06-04 21:12       ` Stephen Hemminger
2018-06-05 13:08         ` [PATCH iproute2 v2 0/2] " Nicolas Dichtel
2018-06-05 13:08           ` [PATCH iproute2 v2 1/2] ip: " Nicolas Dichtel
2018-06-05 16:52             ` Stephen Hemminger
2018-06-06  7:11               ` Nicolas Dichtel
2018-06-05 13:08           ` [PATCH iproute2 v2 2/2] iplink: enable to specify a name for the link-netns Nicolas Dichtel
2018-06-08 17:08           ` [PATCH iproute2 v2 0/2] display netns name instead of nsid Stephen Hemminger
2018-06-04 12:12     ` [PATCH iproute2 2/2] iplink: enable to specify a name for the link-netns Nicolas Dichtel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).