From: Nicolas Dichtel Date: Thu, 31 May 2018 14:28:48 +0000 (+0200) Subject: ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support X-Git-Tag: v4.17.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaf89d7d525eb3e507c3c921fa1089a33de85db7;p=thirdparty%2Fiproute2.git ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support 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: 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 Signed-off-by: Stephen Hemminger --- diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 00da14c6f..c7c7e7df4 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,