iplink: bridge: add support for IFLA_BR_MCAST_SNOOPING
This patch implements support for the IFLA_BR_MCAST_SNOOPING attribute in iproute2 so it can change the multicast snooping value. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
This commit is contained in:
parent
963d137cf9
commit
7ddd2d946c
|
|
@ -33,6 +33,7 @@ static void print_explain(FILE *f)
|
||||||
" [ vlan_filtering VLAN_FILTERING ]\n"
|
" [ vlan_filtering VLAN_FILTERING ]\n"
|
||||||
" [ vlan_protocol VLAN_PROTOCOL ]\n"
|
" [ vlan_protocol VLAN_PROTOCOL ]\n"
|
||||||
" [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
|
" [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
|
||||||
|
" [ mcast_snooping MULTICAST_SNOOPING ]\n"
|
||||||
" [ mcast_router MULTICAST_ROUTER ]\n"
|
" [ mcast_router MULTICAST_ROUTER ]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n"
|
"Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n"
|
||||||
|
|
@ -149,6 +150,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
|
||||||
invarg("invalid mcast_router", *argv);
|
invarg("invalid mcast_router", *argv);
|
||||||
|
|
||||||
addattr8(n, 1024, IFLA_BR_MCAST_ROUTER, mcast_router);
|
addattr8(n, 1024, IFLA_BR_MCAST_ROUTER, mcast_router);
|
||||||
|
} else if (matches(*argv, "mcast_snooping") == 0) {
|
||||||
|
__u8 mcast_snoop;
|
||||||
|
|
||||||
|
NEXT_ARG();
|
||||||
|
if (get_u8(&mcast_snoop, *argv, 0))
|
||||||
|
invarg("invalid mcast_snooping", *argv);
|
||||||
|
|
||||||
|
addattr8(n, 1024, IFLA_BR_MCAST_SNOOPING, mcast_snoop);
|
||||||
} else if (matches(*argv, "help") == 0) {
|
} else if (matches(*argv, "help") == 0) {
|
||||||
explain();
|
explain();
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -287,6 +296,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
|
||||||
1 /*ARPHDR_ETHER*/, mac, sizeof(mac)));
|
1 /*ARPHDR_ETHER*/, mac, sizeof(mac)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tb[IFLA_BR_MCAST_SNOOPING])
|
||||||
|
fprintf(f, "mcast_snooping %u ",
|
||||||
|
rta_getattr_u8(tb[IFLA_BR_MCAST_SNOOPING]));
|
||||||
|
|
||||||
if (tb[IFLA_BR_MCAST_ROUTER])
|
if (tb[IFLA_BR_MCAST_ROUTER])
|
||||||
fprintf(f, "mcast_router %u ",
|
fprintf(f, "mcast_router %u ",
|
||||||
rta_getattr_u8(tb[IFLA_BR_MCAST_ROUTER]));
|
rta_getattr_u8(tb[IFLA_BR_MCAST_ROUTER]));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue