]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 31 May 2018 14:28:48 +0000 (16:28 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 1 Jun 2018 19:59:40 +0000 (15:59 -0400)
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>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipaddress.c

index 00da14c6f97c853f5b622e997b0e004065334eca..c7c7e7df4e813104c47a7d0b5b07414742080fb1 100644 (file)
@@ -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,