From: Nicolas Dichtel Date: Tue, 17 Feb 2015 16:30:39 +0000 (+0100) Subject: bridge/fdb: display link netns id X-Git-Tag: v4.0.0~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4797670d3f38315716231cccf9de2a493feb35f;p=thirdparty%2Fiproute2.git bridge/fdb: display link netns id 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 --- diff --git a/bridge/fdb.c b/bridge/fdb.c index c01a5020d..6941edd90 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -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]);