netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <razor@blackwall.org>
To: netdev@vger.kernel.org
Cc: roopa@nvidia.com, dsahern@gmail.com,
	Nikolay Aleksandrov <nikolay@nvidia.com>
Subject: [PATCH iproute2-next 4/6] bridge: mdb: print filter mode when available
Date: Thu,  8 Oct 2020 16:50:22 +0300	[thread overview]
Message-ID: <20201008135024.1515468-5-razor@blackwall.org> (raw)
In-Reply-To: <20201008135024.1515468-1-razor@blackwall.org>

From: Nikolay Aleksandrov <nikolay@nvidia.com>

Print the mdb entry's filter mode when it's available if the user
requested to show details (-d). It can be either include or exclude.
Currently it's kernel controlled and can't be changed by user-space.

Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
---
 bridge/mdb.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bridge/mdb.c b/bridge/mdb.c
index d33bd5d5c7df..c0cb4fd1421e 100644
--- a/bridge/mdb.c
+++ b/bridge/mdb.c
@@ -150,6 +150,13 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e,
 	print_string(PRINT_ANY, "state", " %s",
 			   (e->state & MDB_PERMANENT) ? "permanent" : "temp");
 
+	if (show_details && tb && tb[MDBA_MDB_EATTR_GROUP_MODE]) {
+		__u8 mode = rta_getattr_u8(tb[MDBA_MDB_EATTR_GROUP_MODE]);
+
+		print_string(PRINT_ANY, "filter_mode", " filter_mode %s",
+			     mode == MCAST_INCLUDE ? "include" : "exclude");
+	}
+
 	open_json_array(PRINT_JSON, "flags");
 	if (e->flags & MDB_FLAGS_OFFLOAD)
 		print_string(PRINT_ANY, NULL, " %s", "offload");
-- 
2.25.4


  parent reply	other threads:[~2020-10-08 13:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 13:50 [PATCH iproute2-next 0/6] bridge: mdb: add support for IGMPv3/MLDv2 attributes Nikolay Aleksandrov
2020-10-08 13:50 ` [PATCH iproute2-next 1/6] bridge: mdb: add support for source address Nikolay Aleksandrov
2020-10-08 13:50 ` [PATCH iproute2-next 2/6] bridge: mdb: print fast_leave flag Nikolay Aleksandrov
2020-10-08 13:50 ` [PATCH iproute2-next 3/6] bridge: mdb: show igmpv3/mldv2 flags Nikolay Aleksandrov
2020-10-08 13:50 ` Nikolay Aleksandrov [this message]
2020-10-08 13:50 ` [PATCH iproute2-next 5/6] bridge: mdb: print source list when available Nikolay Aleksandrov
2020-10-08 13:50 ` [PATCH iproute2-next 6/6] bridge: mdb: print protocol " Nikolay Aleksandrov
2020-10-12  2:08 ` [PATCH iproute2-next 0/6] bridge: mdb: add support for IGMPv3/MLDv2 attributes David Ahern

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=20201008135024.1515468-5-razor@blackwall.org \
    --to=razor@blackwall.org \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@nvidia.com \
    --cc=roopa@nvidia.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;
as well as URLs for NNTP newsgroup(s).