]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iplink: display the value of IFLA_PROMISCUITY
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Tue, 5 Feb 2013 08:38:34 +0000 (00:38 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 5 Feb 2013 16:06:59 +0000 (08:06 -0800)
This is useful to know the 'real' status of an interface (the flag IFF_PROMISC
is exported by the kernel only when the user set it explicitly, for example it
will not be exported when a tcpdump is running).

This information will be displayed when '-details' is provided by the user.

Example:
$ ip -d l l tun10
6: tun10: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN mode DEFAULT
    link/sit 10.16.0.249 peer 10.16.0.121
    sit remote 10.16.0.121 local 10.16.0.249 ttl inherit pmtudisc 6rd-prefix 2002::/16
    promiscuity 2

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

index 2eb1a0a62619b56d746068b5b0f03e49469c3342..e8cab40928c1ccc7023b17f484e9a6cc5db39bea 100644 (file)
@@ -464,6 +464,10 @@ int print_linkinfo(const struct sockaddr_nl *who,
        if (do_link && tb[IFLA_LINKINFO] && show_details)
                print_linktype(fp, tb[IFLA_LINKINFO]);
 
+       if (do_link && tb[IFLA_PROMISCUITY] && show_details)
+               fprintf(fp, "\n    promiscuity %u ",
+                       *(int*)RTA_DATA(tb[IFLA_PROMISCUITY]));
+
        if (do_link && tb[IFLA_IFALIAS])
                fprintf(fp,"\n    alias %s", 
                        rta_getattr_str(tb[IFLA_IFALIAS]));