]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge/fdb: display link netns id
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Tue, 17 Feb 2015 16:30:39 +0000 (17:30 +0100)
committerStephen Hemminger <shemming@brocade.com>
Sun, 22 Feb 2015 00:54:53 +0000 (16:54 -0800)
When this attribute is set, it means that the i/o part of the related netdevice
is in another netns.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
bridge/fdb.c

index c01a5020de634ce7077a150611ed7fc193888071..6941edd90f90dfe2d27ac342e658732eb60dfec8 100644 (file)
@@ -131,12 +131,16 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                if (ifindex) {
                        char ifname[IF_NAMESIZE];
 
-                       if (if_indextoname(ifindex, ifname))
+                       if (!tb[NDA_LINK_NETNSID] &&
+                           if_indextoname(ifindex, ifname))
                                fprintf(fp, "via %s ", ifname);
                        else
                                fprintf(fp, "via ifindex %u ", ifindex);
                }
        }
+       if (tb[NDA_LINK_NETNSID])
+               fprintf(fp, "link-netnsid %d ",
+                       rta_getattr_u32(tb[NDA_LINK_NETNSID]));
 
        if (show_stats && tb[NDA_CACHEINFO]) {
                struct nda_cacheinfo *ci = RTA_DATA(tb[NDA_CACHEINFO]);