From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: shemminger@vyatta.com
Cc: netdev@vger.kernel.org, Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: [PATCH iproute2] iplink: display the value of IFLA_PROMISCUITY
Date: Mon, 28 Jan 2013 15:38:18 +0100 [thread overview]
Message-ID: <1359383898-8047-1-git-send-email-nicolas.dichtel@6wind.com> (raw)
This is usefull 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).
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 <nicolas.dichtel@6wind.com>
---
ip/ipaddress.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 5498f46..0d988ae 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -171,7 +171,7 @@ static void print_queuelen(FILE *f, struct rtattr *tb[IFLA_MAX + 1])
qlen = ifr.ifr_qlen;
}
if (qlen)
- fprintf(f, "qlen %d", qlen);
+ fprintf(f, "qlen %d ", qlen);
}
static const char *link_modes[] = {
@@ -438,6 +438,9 @@ int print_linkinfo(const struct sockaddr_nl *who,
if (filter.showqueue)
print_queuelen(fp, tb);
+ if (tb[IFLA_PROMISCUITY] && *(int*)RTA_DATA(tb[IFLA_PROMISCUITY]) > 0)
+ fprintf(fp, "promiscuity %u ", *(int*)RTA_DATA(tb[IFLA_PROMISCUITY]));
+
if (!filter.family || filter.family == AF_PACKET) {
SPRINT_BUF(b1);
fprintf(fp, "%s", _SL_);
--
1.8.0.1
next reply other threads:[~2013-01-28 14:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-28 14:38 Nicolas Dichtel [this message]
[not found] <CB4696DA7737D0409230B481D0363B1414F0E60461@HQ1-EXCH03.corp.brocade.com>
2013-02-04 17:04 ` [PATCH iproute2] iplink: display the value of IFLA_PROMISCUITY Stephen Hemminger
2013-02-04 17:27 ` Nicolas Dichtel
2013-02-04 17:56 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359383898-8047-1-git-send-email-nicolas.dichtel@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox