iplink: display the value of IFLA_PROMISCUITY
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): CB4696DA7737D0409230B481D0363B1414F0E60461@HQ1-EXCH03.corp.brocade.com
Quoted 11 lines · On Mon, 28 Jan 2013 06:47:56 -0800 Nicolas Dichtel <[email protected]>…
This is usefull to know the 'real' status of an interface (the flag
IFF_PROMISCis exported by the kernel only when the user set it explicitly, for example it will not be exported when a tcpdump is running).Note that I add a space after qlen (instead of before promiscuity) to be coherent with the rest of the code.
Signed-off-by Nicolas Dichtel <[email protected]>--- ip/ipaddress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
The idea is good, but I can't accept in the current form.
The problem with this is that it violates the unwritten assumption that the output of ip command should be the arguments used to setup that interface. There were even some VPN's that depended on that.
Quoted 15 lines · Stephen Hemminger
Quoted 11 lines · On Mon, 28 Jan 2013 06:47:56 -0800 Nicolas Dichtel <[email protected]>…
This is usefull to know the 'real' status of an interface (the flag
IFF_PROMISCis exported by the kernel only when the user set it explicitly, for example it will not be exported when a tcpdump is running).Note that I add a space after qlen (instead of before promiscuity) to be coherent with the rest of the code.
Signed-off-by Nicolas Dichtel <[email protected]>--- ip/ipaddress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Quoted 5 lines
The idea is good, but I can't accept in the current form.
The problem with this is that it violates the unwritten assumption that the output of ip command should be the arguments used to setup that interface. There were even some VPN's that depended on that.
Would it be acceptable to display this information when '-d' (ip -details link) is provided by the user?
Quoted 16 lines · On Mon, 04 Feb 2013 18:27:51 +0100 Nicolas Dichtel <[email protected]>…
Quoted 15 lines · Stephen Hemminger
Quoted 11 lines · On Mon, 28 Jan 2013 06:47:56 -0800 Nicolas Dichtel <[email protected]>…
This is usefull to know the 'real' status of an interface (the flag
IFF_PROMISCis exported by the kernel only when the user set it explicitly, for example it will not be exported when a tcpdump is running).Note that I add a space after qlen (instead of before promiscuity) to be coherent with the rest of the code.
Signed-off-by Nicolas Dichtel <[email protected]>--- ip/ipaddress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Quoted 7 lines
Quoted 5 lines
The idea is good, but I can't accept in the current form.
The problem with this is that it violates the unwritten assumption that the output of ip command should be the arguments used to setup that interface. There were even some VPN's that depended on that.Would it be acceptable to display this information when '-d' (ip -details link) is provided by the user?
Yeah, that seems to be where such things end up.
PATCH v2 1/1 iplink: display the value of IFLA_PROMISCUITY
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---
v2: because IFLA_PROMISCUITY is read only, display it only when '-details' is
provided (and even if the value is zero)
ip/ipaddress.c | 4 ++++ 1 file changed, 4 insertions(+)
ip/ipaddress.c +4 -0
@@ -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 ]));
Signature · 1 line
1.8.0.1