add latest bridge netlink options
Subsystems (2)
v2 cover add latest bridge netlink options
Add the bridge netlink attributes added to kernel recently.
v2: rename vlan/mcast_state to vlan/mcast_stats_enabled as suggested by Nikolay. The previous name has different meaning and will mislead people. I will post a separate patch for IFLA_BRPORT_FLUSH support.
Hangbin Liu (5):
iplink: bridge: add support for IFLA_BR_FDB_FLUSH
iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
ip/iplink_bridge.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-)
Signature · 1 line
2.5.5
PATCH v2 1/5 iplink: bridge: add support for IFLA_BR_FDB_FLUSH
This patch implements support for the IFLA_BR_FDB_FLUSH attribute in iproute2 so it can flush bridge fdb dynamic entries.
--- ip/iplink_bridge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
ip/iplink_bridge.c +4 -1
@@ -22,7 +22,8 @@static void print_explain (FILE *f) {fprintf (f, -"Usage: ... bridge [ forward_delay FORWARD_DELAY ]\n" +"Usage: ... bridge [ fdb_flush ]\n" +" [ forward_delay FORWARD_DELAY ]\n" " [ hello_time HELLO_TIME ]\n" " [ max_age MAX_AGE ]\n" " [ ageing_time AGEING_TIME ]\n"
@@ -145,6 +146,8 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,if (len <0 )return -1 ;addattr_l (n,1024 ,IFLA_BR_GROUP_ADDR , llabuf, len); + }else if (matches (*argv,"fdb_flush" ) ==0 ) { +addattr (n,1024 ,IFLA_BR_FDB_FLUSH ); }else if (matches (*argv,"vlan_default_pvid" ) ==0 ) {__u16 default_pvid;
Signature · 1 line
2.5.5
Stephen Hemminger
AppliedRe: [PATCHv2 iproute2 net-next 1/5] iplink: bridge: add support for IFLA_BR_FDB_FLUSH
Quoted 9 lines · On Wed, 18 Jan 2017 14:12:47 +0800 Hangbin Liu <[email protected]> wrote:
This patch implements support for the
IFLA_BR_FDB_FLUSHattribute in iproute2 so it can flush bridge fdb dynamic entries.Reviewed-by Nikolay Aleksandrov <[email protected]>Signed-off-by Hangbin Liu <[email protected]>--- ip/iplink_bridge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Applied all of these to net-next, please update man pages.
PATCH v2 2/5 iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
In reply to Hangbin LiuThis patch implements support for the IFLA_BR_VLAN_STATS_ENABLED attribute in iproute2 so it can enable/disable vlan stats accounting.
--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
ip/iplink_bridge.c +13 -0
@@ -34,6 +34,7 @@ static void print_explain(FILE *f)" [ vlan_filtering VLAN_FILTERING ]\n" " [ vlan_protocol VLAN_PROTOCOL ]\n" " [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n" +" [ vlan_stats_enabled VLAN_STATS_ENABLED ]\n" " [ mcast_snooping MULTICAST_SNOOPING ]\n" " [ mcast_router MULTICAST_ROUTER ]\n" " [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
@@ -157,6 +158,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,addattr16 (n,1024 ,IFLA_BR_VLAN_DEFAULT_PVID , default_pvid); + }else if (matches (*argv,"vlan_stats_enabled" ) ==0 ) { +__u8 vlan_stats_enabled; + +NEXT_ARG (); +if (get_u8 (&vlan_stats_enabled, *argv,0 )) +invarg ("invalid vlan_stats_enabled" , *argv); +addattr8 (n,1024 ,IFLA_BR_VLAN_STATS_ENABLED , + vlan_stats_enabled); }else if (matches (*argv,"mcast_router" ) ==0 ) {__u8 mcast_router;
@@ -442,6 +451,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])fprintf (f,"vlan_default_pvid %u " ,rta_getattr_u16 (tb[IFLA_BR_VLAN_DEFAULT_PVID ])); +if (tb[IFLA_BR_VLAN_STATS_ENABLED ]) +fprintf (f,"vlan_stats_enabled %u " , +rta_getattr_u8 (tb[IFLA_BR_VLAN_STATS_ENABLED ])); +if (tb[IFLA_BR_GROUP_FWD_MASK ])fprintf (f,"group_fwd_mask %#x " ,rta_getattr_u16 (tb[IFLA_BR_GROUP_FWD_MASK ]));
Signature · 1 line
2.5.5
Re: [PATCHv2 iproute2 net-next 2/5] iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
Quoted 8 lines · Hangbin Liu
This patch implements support for the
IFLA_BR_VLAN_STATS_ENABLEDattribute in iproute2 so it can enable/disable vlan stats accounting.Signed-off-by Hangbin Liu <[email protected]>--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Thanks,
PATCH v2 3/5 iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
In reply to Hangbin LiuThis patch implements support for the IFLA_BR_MCAST_STATS_ENABLED attribute in iproute2 so it can enable/disable mcast stats accounting.
--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
ip/iplink_bridge.c +13 -0
@@ -49,6 +49,7 @@ static void print_explain(FILE *f)" [ mcast_query_interval QUERY_INTERVAL ]\n" " [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n" " [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n" +" [ mcast_stats_enabled MCAST_STATS_ENABLED ]\n" " [ nf_call_iptables NF_CALL_IPTABLES ]\n" " [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n" " [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -299,6 +300,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,addattr64 (n,1024 ,IFLA_BR_MCAST_STARTUP_QUERY_INTVL , mcast_startup_query_intvl); + }else if (matches (*argv,"mcast_stats_enabled" ) ==0 ) { +__u8 mcast_stats_enabled; + +NEXT_ARG (); +if (get_u8 (&mcast_stats_enabled, *argv,0 )) +invarg ("invalid mcast_stats_enabled" , *argv); +addattr8 (n,1024 ,IFLA_BR_MCAST_STATS_ENABLED , + mcast_stats_enabled); }else if (matches (*argv,"nf_call_iptables" ) ==0 ) {__u8 nf_call_ipt;
@@ -524,6 +533,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])fprintf (f,"mcast_startup_query_interval %llu " ,rta_getattr_u64 (tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL ])); +if (tb[IFLA_BR_MCAST_STATS_ENABLED ]) +fprintf (f,"mcast_stats_enabled %u " , +rta_getattr_u8 (tb[IFLA_BR_MCAST_STATS_ENABLED ])); +if (tb[IFLA_BR_NF_CALL_IPTABLES ])fprintf (f,"nf_call_iptables %u " ,rta_getattr_u8 (tb[IFLA_BR_NF_CALL_IPTABLES ]));
Signature · 1 line
2.5.5
Re: [PATCHv2 iproute2 net-next 3/5] iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
Quoted 8 lines · Hangbin Liu
This patch implements support for the
IFLA_BR_MCAST_STATS_ENABLEDattribute in iproute2 so it can enable/disable mcast stats accounting.Signed-off-by Hangbin Liu <[email protected]>--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Thanks,
PATCH v2 4/5 iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
In reply to Hangbin LiuThis patch implements support for the IFLA_BR_MCAST_IGMP_VERSION attribute in iproute2 so it can change the mcast igmp version.
--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
ip/iplink_bridge.c +13 -0
@@ -50,6 +50,7 @@ static void print_explain(FILE *f)" [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n" " [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n" " [ mcast_stats_enabled MCAST_STATS_ENABLED ]\n" +" [ mcast_igmp_version IGMP_VERSION ]\n" " [ nf_call_iptables NF_CALL_IPTABLES ]\n" " [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n" " [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -308,6 +309,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,invarg ("invalid mcast_stats_enabled" , *argv);addattr8 (n,1024 ,IFLA_BR_MCAST_STATS_ENABLED , mcast_stats_enabled); + }else if (matches (*argv,"mcast_igmp_version" ) ==0 ) { +__u8 igmp_version; + +NEXT_ARG (); +if (get_u8 (&igmp_version, *argv,0 )) +invarg ("invalid mcast_igmp_version" , *argv); +addattr8 (n,1024 ,IFLA_BR_MCAST_IGMP_VERSION , + igmp_version); }else if (matches (*argv,"nf_call_iptables" ) ==0 ) {__u8 nf_call_ipt;
@@ -537,6 +546,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])fprintf (f,"mcast_stats_enabled %u " ,rta_getattr_u8 (tb[IFLA_BR_MCAST_STATS_ENABLED ])); +if (tb[IFLA_BR_MCAST_IGMP_VERSION ]) +fprintf (f,"mcast_igmp_version %u " , +rta_getattr_u8 (tb[IFLA_BR_MCAST_IGMP_VERSION ])); +if (tb[IFLA_BR_NF_CALL_IPTABLES ])fprintf (f,"nf_call_iptables %u " ,rta_getattr_u8 (tb[IFLA_BR_NF_CALL_IPTABLES ]));
Signature · 1 line
2.5.5
PATCH v2 5/5 iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
In reply to Hangbin LiuThis patch implements support for the IFLA_BR_MCAST_MLD_VERSION attribute in iproute2 so it can change the mcast mld version.
--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
ip/iplink_bridge.c +13 -0
@@ -51,6 +51,7 @@ static void print_explain(FILE *f)" [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n" " [ mcast_stats_enabled MCAST_STATS_ENABLED ]\n" " [ mcast_igmp_version IGMP_VERSION ]\n" +" [ mcast_mld_version MLD_VERSION ]\n" " [ nf_call_iptables NF_CALL_IPTABLES ]\n" " [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n" " [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -317,6 +318,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,invarg ("invalid mcast_igmp_version" , *argv);addattr8 (n,1024 ,IFLA_BR_MCAST_IGMP_VERSION , igmp_version); + }else if (matches (*argv,"mcast_mld_version" ) ==0 ) { +__u8 mld_version; + +NEXT_ARG (); +if (get_u8 (&mld_version, *argv,0 )) +invarg ("invalid mcast_mld_version" , *argv); +addattr8 (n,1024 ,IFLA_BR_MCAST_MLD_VERSION , + mld_version); }else if (matches (*argv,"nf_call_iptables" ) ==0 ) {__u8 nf_call_ipt;
@@ -550,6 +559,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])fprintf (f,"mcast_igmp_version %u " ,rta_getattr_u8 (tb[IFLA_BR_MCAST_IGMP_VERSION ])); +if (tb[IFLA_BR_MCAST_MLD_VERSION ]) +fprintf (f,"mcast_mld_version %u " , +rta_getattr_u8 (tb[IFLA_BR_MCAST_MLD_VERSION ])); +if (tb[IFLA_BR_NF_CALL_IPTABLES ])fprintf (f,"nf_call_iptables %u " ,rta_getattr_u8 (tb[IFLA_BR_NF_CALL_IPTABLES ]));
Signature · 1 line
2.5.5