]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: mdb: print filter mode when available
authorNikolay Aleksandrov <nikolay@nvidia.com>
Thu, 8 Oct 2020 13:50:22 +0000 (16:50 +0300)
committerDavid Ahern <dsahern@gmail.com>
Mon, 12 Oct 2020 02:07:39 +0000 (20:07 -0600)
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>
Signed-off-by: David Ahern <dsahern@gmail.com>
bridge/mdb.c

index d33bd5d5c7df1b0cf047da8384d23c01b9ba4124..c0cb4fd1421e1d4a6611a53a01f4549cda55314b 100644 (file)
@@ -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");