bridge: mcast: add mcast_active_v4 / mcast_active_v6 output
Subsystems (3)
PATCH 1/1 bridge: mcast: add mcast_active_v4 / mcast_active_v6 output
Add output for the mcast_active_v4 and mcast_active_v6 states. If their output is 1 then IGMP/MLD snooping is applied to multicast payload traffic of their according protocol family. This is the case when:
* the bridge interface is up
* multicast snooping is enabled
* an IGMP/MLD querier is present
* for own IPv6 MLD querier: an IPv6 address is configured on the bridge
--- bridge/vlan.c | 10 ++++++++++ include/uapi/linux/if_bridge.h | 2 ++ include/uapi/linux/if_link.h | 2 ++ ip/iplink_bridge.c | 12 ++++++++++++ 4 files changed, 26 insertions(+)
bridge/vlan.c +10 -0
@@ -920,6 +920,16 @@ static void print_vlan_global_opts(struct rtattr *a, int ifindex)print_uint (PRINT_ANY ,"msti" ,"msti %u " ,rta_getattr_u16 (vattr)); } +if (vtb[BRIDGE_VLANDB_GOPTS_MCAST_ACTIVE_V4 ]) { + vattr = vtb[BRIDGE_VLANDB_GOPTS_MCAST_ACTIVE_V4 ]; +print_uint (PRINT_ANY ,"mcast_active_v4" ,"mcast_active_v4 %u " , +rta_getattr_u8 (vattr)); + } +if (vtb[BRIDGE_VLANDB_GOPTS_MCAST_ACTIVE_V6 ]) { + vattr = vtb[BRIDGE_VLANDB_GOPTS_MCAST_ACTIVE_V6 ]; +print_uint (PRINT_ANY ,"mcast_active_v6" ,"mcast_active_v6 %u " , +rta_getattr_u8 (vattr)); + }print_nl ();if (vtb[BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS ]) { vattr =RTA_DATA (vtb[BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS ]);
include/uapi/linux/if_bridge.h +2 -0
@@ -584,6 +584,8 @@ enum {BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS ,BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE ,BRIDGE_VLANDB_GOPTS_MSTI , +BRIDGE_VLANDB_GOPTS_MCAST_ACTIVE_V4 , +BRIDGE_VLANDB_GOPTS_MCAST_ACTIVE_V6 , __BRIDGE_VLANDB_GOPTS_MAX };#define BRIDGE_VLANDB_GOPTS_MAX (__BRIDGE_VLANDB_GOPTS_MAX - 1)
include/uapi/linux/if_link.h +2 -0
@@ -794,6 +794,8 @@ enum {IFLA_BR_MCAST_QUERIER_STATE ,IFLA_BR_FDB_N_LEARNED ,IFLA_BR_FDB_MAX_LEARNED , +IFLA_BR_MCAST_ACTIVE_V4 , +IFLA_BR_MCAST_ACTIVE_V6 , __IFLA_BR_MAX, };
ip/iplink_bridge.c +12 -0
@@ -784,6 +784,18 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])"mcast_mld_version %u " , rta_getattr_u8(tb[IFLA_BR_MCAST_MLD_VERSION])); +if (tb[IFLA_BR_MCAST_ACTIVE_V4 ]) +print_uint (PRINT_ANY , +"mcast_active_v4" , +"mcast_active_v4 %u " , +rta_getattr_u8 (tb[IFLA_BR_MCAST_ACTIVE_V4 ])); + +if (tb[IFLA_BR_MCAST_ACTIVE_V6 ]) +print_uint (PRINT_ANY , +"mcast_active_v6" , +"mcast_active_v6 %u " , +rta_getattr_u8 (tb[IFLA_BR_MCAST_ACTIVE_V6 ])); +if (tb[IFLA_BR_NF_CALL_IPTABLES ]) print_uint(PRINT_ANY, "nf_call_iptables",
Signature · 1 line
2.51.0
Ido Schimmel
maintainerQuoted 9 lines · Linus Lüssing
Add output for the
mcast_active_v4andmcast_active_v6states. If their output is 1 then IGMP/MLD snooping is applied to multicast payload traffic of their according protocol family. This is the case when:* the bridge interface is up
* multicast snooping is enabled
* an IGMP/MLD querier is present
* for own IPv6 MLD querier: an IPv6 address is configured on the bridge
Quoted 5 lines
Signed-off-by Linus Lüssing <[email protected]>--- bridge/vlan.c | 10 ++++++++++ include/uapi/linux/if_bridge.h | 2 ++ include/uapi/linux/if_link.h | 2 ++
Code looks fine, but note that David asks to split the uAPI header changes to a separate patch as a hint for him to sync the headers. See commit a3ec2778576b ("Update kernel headers") for example.
Quoted 2 lines
ip/iplink_bridge.c | 12 ++++++++++++ 4 files changed, 26 insertions(+)