bridge: complete netlink support
Subsystems (3)
v2 cover bridge: complete netlink support
From: Nikolay Aleksandrov <[email protected]>
Hi,
After I added support for all attributes in the kernel, it's time to make use of them in iproute2. I've tested changing/viewing all of the attributes. I'll send a separate set to add support for the ports attributes.
For the future, adding a switch to change to "seconds.milliseconds" format for the timers would be helpful (I've stuck to the currently used clock_t export to be consistent).
v2: use ether_ntoa_r to print the bridge/root ids, and convert read-only timers to seconds.milliseconds format as per Stephen's comments
Cheers,
Nik
Nikolay Aleksandrov (21):
iplink: bridge: export bridge_id and designated_root
iplink: bridge: export root_(port|path_cost), topology_change and
change_detected
iplink: bridge: export read-only timers
iplink: bridge: add support for IFLA_BR_GROUP_FWD_MASK
iplink: bridge: add support for IFLA_BR_GROUP_ADDR
iplink: bridge: add support for IFLA_BR_VLAN_DEFAULT_PVID
iplink: bridge: add support for IFLA_BR_MCAST_ROUTER
iplink: bridge: add support for IFLA_BR_MCAST_SNOOPING
iplink: bridge: add support for IFLA_BR_MCAST_QUERY_USE_IFADDR
iplink: bridge: add support for IFLA_BR_MCAST_QUERIER
iplink: bridge: add support for IFLA_BR_MCAST_HASH_ELASTICITY
iplink: bridge: add support for IFLA_BR_MCAST_HASH_MAX
iplink: bridge: add support for IFLA_BR_MCAST_LAST_MEMBER_CNT
iplink: bridge: add support for IFLA_BR_MCAST_STARTUP_QUERY_CNT
iplink: bridge: add support for IFLA_BR_MCAST_LAST_MEMBER_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_MEMBERSHIP_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_QUERIER_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_QUERY_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_QUERY_RESPONSE_INTVL
iplink: bridge: add support for IFLA_BR_MCAST_STARTUP_QUERY_INTVL
iplink: bridge: add support for netfilter call attributes
include/utils.h | 18 +++ ip/iplink_bridge.c | 375 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 393 insertions(+)
Signature · 1 line
2.4.3
PATCH v2 1/21 iplink: bridge: export bridge_id and designated_root
From: Nikolay Aleksandrov <[email protected]>
Netlink returns the bridge_id and designated_root, we just need to make them visible.
---
v2: use ether_ntoa_r in bridge_id dump
ip/iplink_bridge.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
ip/iplink_bridge.c +26 -0
@@ -13,6 +13,7 @@#include <stdlib.h> #include <string.h> #include <linux/if_link.h> +#include <netinet/ether.h> #include "rt_names.h" #include "utils.h"
@@ -39,6 +40,15 @@ static void explain(void)print_explain (stderr); } +static void br_dump_bridge_id (const struct ifla_bridge_id *id,char *buf, +size_t len) +{ +char eaddr[32 ]; + +ether_ntoa_r ((const struct ether_addr *)id->addr, eaddr); +snprintf (buf, len,"%.2x%.2x.%s" , id->prio[0 ], id->prio[1 ], eaddr); +} +static int bridge_parse_opt (struct link_util *lu,int argc,char **argv,struct nlmsghdr *n) {
@@ -155,6 +165,22 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])ll_proto_n2a (rta_getattr_u16 (tb[IFLA_BR_VLAN_PROTOCOL ]), b1, sizeof(b1))); } + +if (tb[IFLA_BR_BRIDGE_ID ]) { +char bridge_id[32 ]; + +br_dump_bridge_id (RTA_DATA (tb[IFLA_BR_BRIDGE_ID ]), bridge_id, +sizeof (bridge_id)); +fprintf (f,"bridge_id %s " , bridge_id); + } + +if (tb[IFLA_BR_ROOT_ID ]) { +char root_id[32 ]; + +br_dump_bridge_id (RTA_DATA (tb[IFLA_BR_BRIDGE_ID ]), root_id, +sizeof (root_id)); +fprintf (f,"designated_root %s " , root_id); + } } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
Re: [PATCH iproute2 v2 01/21] iplink: bridge: export bridge_id and designated_root
Quoted 6 lines · On Tue, 9 Feb 2016 00:14:19 +0100 Nikolay Aleksandrov <[email protected]>…
From: Nikolay Aleksandrov <[email protected]>
Netlink returns the
bridge_idanddesignated_root, we just need to make them visible.Signed-off-by Nikolay Aleksandrov <[email protected]>
Series applied.
PATCH v2 2/21 iplink: bridge: export root_(port|path_cost), topology_change and change_detected
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
Netlink already export these values, we just need to make them visible.
--- ip/iplink_bridge.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
ip/iplink_bridge.c +16 -0
@@ -181,6 +181,22 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) sizeof(root_id));fprintf (f,"designated_root %s " , root_id); } + +if (tb[IFLA_BR_ROOT_PORT ]) +fprintf (f,"root_port %u " , +rta_getattr_u16 (tb[IFLA_BR_ROOT_PORT ])); + +if (tb[IFLA_BR_ROOT_PATH_COST ]) +fprintf (f,"root_path_cost %u " , +rta_getattr_u32 (tb[IFLA_BR_ROOT_PATH_COST ])); + +if (tb[IFLA_BR_TOPOLOGY_CHANGE ]) +fprintf (f,"topology_change %u " , +rta_getattr_u8 (tb[IFLA_BR_TOPOLOGY_CHANGE ])); + +if (tb[IFLA_BR_TOPOLOGY_CHANGE_DETECTED ]) +fprintf (f,"topology_change_detected %u " , +rta_getattr_u8 (tb[IFLA_BR_TOPOLOGY_CHANGE_DETECTED ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 3/21 iplink: bridge: export read-only timers
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
Netlink already provides hello_timer, tcn_timer, topology_change_timer and gc_timer, so let's make them visible.
---
v2: export timers in seconds.milliseconds format as per Stephen's comment
include/utils.h | 18 ++++++++++++++++++ ip/iplink_bridge.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+)
include/utils.h +18 -0
@@ -175,6 +175,24 @@ static inline __u32 nl_mgrp(__u32 group)return group ? (1 << (group -1 )) :0 ; } +/* courtesy of bridge-utils */ +static inline unsigned long __tv_to_jiffies (const struct timeval *tv) +{ +unsigned long long jif; + + jif =1000000ULL * tv->tv_sec + tv->tv_usec; + +return jif/10000 ; +} + +static inline void __jiffies_to_tv (struct timeval *tv,unsigned long jiffies) +{ +unsigned long long tvusec; + + tvusec =10000ULL *jiffies; + tv->tv_sec = tvusec/1000000 ; + tv->tv_usec = tvusec -1000000 * tv->tv_sec; +}int print_timestamp (FILE *fp);void print_nlmsg_timestamp (FILE *fp,const struct nlmsghdr *n);
ip/iplink_bridge.c +34 -0
@@ -197,6 +197,40 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_TOPOLOGY_CHANGE_DETECTED ])fprintf (f,"topology_change_detected %u " ,rta_getattr_u8 (tb[IFLA_BR_TOPOLOGY_CHANGE_DETECTED ])); + +if (tb[IFLA_BR_HELLO_TIMER ]) { +struct timeval tv; + +__jiffies_to_tv (&tv,rta_getattr_u64 (tb[IFLA_BR_HELLO_TIMER ])); +fprintf (f,"hello_timer %4i.%.2i " , (int )tv.tv_sec, + (int )tv.tv_usec/10000 ); + } + +if (tb[IFLA_BR_TCN_TIMER ]) { +struct timeval tv; + +__jiffies_to_tv (&tv,rta_getattr_u64 (tb[IFLA_BR_TCN_TIMER ])); +fprintf (f,"tcn_timer %4i.%.2i " , (int )tv.tv_sec, + (int )tv.tv_usec/10000 ); + } + +if (tb[IFLA_BR_TOPOLOGY_CHANGE_TIMER ]) { +unsigned long jiffies; +struct timeval tv; + + jiffies =rta_getattr_u64 (tb[IFLA_BR_TOPOLOGY_CHANGE_TIMER ]); +__jiffies_to_tv (&tv, jiffies); +fprintf (f,"topology_change_timer %4i.%.2i " , (int )tv.tv_sec, + (int )tv.tv_usec/10000 ); + } + +if (tb[IFLA_BR_GC_TIMER ]) { +struct timeval tv; + +__jiffies_to_tv (&tv,rta_getattr_u64 (tb[IFLA_BR_GC_TIMER ])); +fprintf (f,"gc_timer %4i.%.2i " , (int )tv.tv_sec, + (int )tv.tv_usec/10000 ); + } } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 4/21 iplink: bridge: add support for IFLA_BR_GROUP_FWD_MASK
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_GROUP_FWD_MASK attribute in iproute2 so it can change the group forwarding mask.
--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
ip/iplink_bridge.c +13 -0
@@ -28,6 +28,7 @@ static void print_explain(FILE *f)" [ ageing_time AGEING_TIME ]\n" " [ stp_state STP_STATE ]\n" " [ priority PRIORITY ]\n" +" [ group_fwd_mask MASK ]\n" " [ vlan_filtering VLAN_FILTERING ]\n" " [ vlan_protocol VLAN_PROTOCOL ]\n" "\n"
@@ -111,6 +112,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,return -1 ; }addattr16 (n,1024 ,IFLA_BR_VLAN_PROTOCOL , vlan_proto); + }else if (matches (*argv,"group_fwd_mask" ) ==0 ) { +__u16 fwd_mask; + +NEXT_ARG (); +if (get_u16 (&fwd_mask, *argv,0 )) +invarg ("invalid group_fwd_mask" , *argv); + +addattr16 (n,1024 ,IFLA_BR_GROUP_FWD_MASK , fwd_mask); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -231,6 +240,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])fprintf (f,"gc_timer %4i.%.2i " , (int )tv.tv_sec, (int )tv.tv_usec/10000 ); } + +if (tb[IFLA_BR_GROUP_FWD_MASK ]) +fprintf (f,"group_fwd_mask %#x " , +rta_getattr_u16 (tb[IFLA_BR_GROUP_FWD_MASK ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 5/21 iplink: bridge: add support for IFLA_BR_GROUP_ADDR
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_GROUP_ADDR attribute in iproute2 so it can change the group address.
--- ip/iplink_bridge.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
ip/iplink_bridge.c +19 -0
@@ -29,6 +29,7 @@ static void print_explain(FILE *f)" [ stp_state STP_STATE ]\n" " [ priority PRIORITY ]\n" " [ group_fwd_mask MASK ]\n" +" [ group_address ADDRESS ]\n" " [ vlan_filtering VLAN_FILTERING ]\n" " [ vlan_protocol VLAN_PROTOCOL ]\n" "\n"
@@ -120,6 +121,15 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,invarg ("invalid group_fwd_mask" , *argv);addattr16 (n,1024 ,IFLA_BR_GROUP_FWD_MASK , fwd_mask); + }else if (matches (*argv,"group_address" ) ==0 ) { +char llabuf[32 ]; +int len; + +NEXT_ARG (); + len =ll_addr_a2n (llabuf,sizeof (llabuf), *argv); +if (len <0 ) +return -1 ; +addattr_l (n,1024 ,IFLA_BR_GROUP_ADDR , llabuf, len); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -244,6 +254,15 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_GROUP_FWD_MASK ])fprintf (f,"group_fwd_mask %#x " ,rta_getattr_u16 (tb[IFLA_BR_GROUP_FWD_MASK ])); + +if (tb[IFLA_BR_GROUP_ADDR ]) { +SPRINT_BUF (mac); + +fprintf (f,"group_address %s " , +ll_addr_n2a (RTA_DATA (tb[IFLA_BR_GROUP_ADDR ]), +RTA_PAYLOAD (tb[IFLA_BR_GROUP_ADDR ]), +1 /*ARPHDR_ETHER*/ , mac,sizeof (mac))); + } } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 6/21 iplink: bridge: add support for IFLA_BR_VLAN_DEFAULT_PVID
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_VLAN_DEFAULT_PVID attribute in iproute2 so it can change the default pvid.
--- ip/iplink_bridge.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
ip/iplink_bridge.c +14 -0
@@ -32,6 +32,7 @@ static void print_explain(FILE *f)" [ group_address ADDRESS ]\n" " [ vlan_filtering VLAN_FILTERING ]\n" " [ vlan_protocol VLAN_PROTOCOL ]\n" +" [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -130,6 +131,15 @@ 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,"vlan_default_pvid" ) ==0 ) { +__u16 default_pvid; + +NEXT_ARG (); +if (get_u16 (&default_pvid, *argv,0 )) +invarg ("invalid vlan_default_pvid" , *argv); + +addattr16 (n,1024 ,IFLA_BR_VLAN_DEFAULT_PVID , + default_pvid); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -251,6 +261,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) (int)tv.tv_usec/10000); } +if (tb[IFLA_BR_VLAN_DEFAULT_PVID ]) +fprintf (f,"vlan_default_pvid %u " , +rta_getattr_u16 (tb[IFLA_BR_VLAN_DEFAULT_PVID ])); +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.4.3
PATCH v2 7/21 iplink: bridge: add support for IFLA_BR_MCAST_ROUTER
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_ROUTER attribute in iproute2 so it can change the multicast router value.
--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
ip/iplink_bridge.c +13 -0
@@ -33,6 +33,7 @@ static void print_explain(FILE *f)" [ vlan_filtering VLAN_FILTERING ]\n" " [ vlan_protocol VLAN_PROTOCOL ]\n" " [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n" +" [ mcast_router MULTICAST_ROUTER ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -140,6 +141,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,"mcast_router" ) ==0 ) { +__u8 mcast_router; + +NEXT_ARG (); +if (get_u8 (&mcast_router, *argv,0 )) +invarg ("invalid mcast_router" , *argv); + +addattr8 (n,1024 ,IFLA_BR_MCAST_ROUTER , mcast_router); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -277,6 +286,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])RTA_PAYLOAD (tb[IFLA_BR_GROUP_ADDR ]), 1 /*ARPHDR_ETHER*/, mac, sizeof(mac))); } + +if (tb[IFLA_BR_MCAST_ROUTER ]) +fprintf (f,"mcast_router %u " , +rta_getattr_u8 (tb[IFLA_BR_MCAST_ROUTER ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 8/21 iplink: bridge: add support for IFLA_BR_MCAST_SNOOPING
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_SNOOPING attribute in iproute2 so it can change the multicast snooping value.
--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
ip/iplink_bridge.c +13 -0
@@ -33,6 +33,7 @@ static void print_explain(FILE *f)" [ vlan_filtering VLAN_FILTERING ]\n" " [ vlan_protocol VLAN_PROTOCOL ]\n" " [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n" +" [ mcast_snooping MULTICAST_SNOOPING ]\n" " [ mcast_router MULTICAST_ROUTER ]\n" "\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);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 ) {explain ();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))); } +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 ])fprintf (f,"mcast_router %u " ,rta_getattr_u8 (tb[IFLA_BR_MCAST_ROUTER ]));
Signature · 1 line
2.4.3
PATCH v2 9/21 iplink: bridge: add support for IFLA_BR_MCAST_QUERY_USE_IFADDR
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_QUERY_USE_IFADDR attribute in iproute2 so it can toggle the multicast_query_use_ifaddr val.
--- ip/iplink_bridge.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ip/iplink_bridge.c +15 -0
@@ -35,6 +35,7 @@ static void print_explain(FILE *f)" [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n" " [ mcast_snooping MULTICAST_SNOOPING ]\n" " [ mcast_router MULTICAST_ROUTER ]\n" +" [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -158,6 +159,16 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,invarg ("invalid mcast_snooping" , *argv);addattr8 (n,1024 ,IFLA_BR_MCAST_SNOOPING , mcast_snoop); + }else if (matches (*argv,"mcast_query_use_ifaddr" ) ==0 ) { +__u8 mcast_qui; + +NEXT_ARG (); +if (get_u8 (&mcast_qui, *argv,0 )) +invarg ("invalid mcast_query_use_ifaddr" , + *argv); + +addattr8 (n,1024 ,IFLA_BR_MCAST_QUERY_USE_IFADDR , + mcast_qui); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -303,6 +314,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_ROUTER ])fprintf (f,"mcast_router %u " ,rta_getattr_u8 (tb[IFLA_BR_MCAST_ROUTER ])); + +if (tb[IFLA_BR_MCAST_QUERY_USE_IFADDR ]) +fprintf (f,"mcast_query_use_ifaddr %u " , +rta_getattr_u8 (tb[IFLA_BR_MCAST_QUERY_USE_IFADDR ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 10/21 iplink: bridge: add support for IFLA_BR_MCAST_QUERIER
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_QUERIER attribute in iproute2 so it can toggle the mcast querier value.
--- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
ip/iplink_bridge.c +13 -0
@@ -36,6 +36,7 @@ static void print_explain(FILE *f)" [ mcast_snooping MULTICAST_SNOOPING ]\n" " [ mcast_router MULTICAST_ROUTER ]\n" " [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n" +" [ mcast_querier MULTICAST_QUERIER ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -169,6 +170,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,addattr8 (n,1024 ,IFLA_BR_MCAST_QUERY_USE_IFADDR , mcast_qui); + }else if (matches (*argv,"mcast_querier" ) ==0 ) { +__u8 mcast_querier; + +NEXT_ARG (); +if (get_u8 (&mcast_querier, *argv,0 )) +invarg ("invalid mcast_querier" , *argv); + +addattr8 (n,1024 ,IFLA_BR_MCAST_QUERIER , mcast_querier); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -318,6 +327,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_QUERY_USE_IFADDR ])fprintf (f,"mcast_query_use_ifaddr %u " ,rta_getattr_u8 (tb[IFLA_BR_MCAST_QUERY_USE_IFADDR ])); + +if (tb[IFLA_BR_MCAST_QUERIER ]) +fprintf (f,"mcast_querier %u " , +rta_getattr_u8 (tb[IFLA_BR_MCAST_QUERIER ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 11/21 iplink: bridge: add support for IFLA_BR_MCAST_HASH_ELASTICITY
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_HASH_ELASTICTITY attribute in iproute2 so it can change the hash elasticity value.
--- ip/iplink_bridge.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ip/iplink_bridge.c +15 -0
@@ -37,6 +37,7 @@ static void print_explain(FILE *f)" [ mcast_router MULTICAST_ROUTER ]\n" " [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n" " [ mcast_querier MULTICAST_QUERIER ]\n" +" [ mcast_hash_elasticity HASH_ELASTICITY ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -178,6 +179,16 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,invarg ("invalid mcast_querier" , *argv);addattr8 (n,1024 ,IFLA_BR_MCAST_QUERIER , mcast_querier); + }else if (matches (*argv,"mcast_hash_elasticity" ) ==0 ) { +__u32 mcast_hash_el; + +NEXT_ARG (); +if (get_u32 (&mcast_hash_el, *argv,0 )) +invarg ("invalid mcast_hash_elasticity" , + *argv); + +addattr32 (n,1024 ,IFLA_BR_MCAST_HASH_ELASTICITY , + mcast_hash_el); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -331,6 +342,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_QUERIER ])fprintf (f,"mcast_querier %u " ,rta_getattr_u8 (tb[IFLA_BR_MCAST_QUERIER ])); + +if (tb[IFLA_BR_MCAST_HASH_ELASTICITY ]) +fprintf (f,"mcast_hash_elasticity %u " , +rta_getattr_u32 (tb[IFLA_BR_MCAST_HASH_ELASTICITY ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 12/21 iplink: bridge: add support for IFLA_BR_MCAST_HASH_MAX
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_HASH_MAX attribute in iproute2 so it can change the maximum hashed entries.
--- ip/iplink_bridge.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
ip/iplink_bridge.c +14 -0
@@ -38,6 +38,7 @@ static void print_explain(FILE *f)" [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n" " [ mcast_querier MULTICAST_QUERIER ]\n" " [ mcast_hash_elasticity HASH_ELASTICITY ]\n" +" [ mcast_hash_max HASH_MAX ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -189,6 +190,15 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,addattr32 (n,1024 ,IFLA_BR_MCAST_HASH_ELASTICITY , mcast_hash_el); + }else if (matches (*argv,"mcast_hash_max" ) ==0 ) { +__u32 mcast_hash_max; + +NEXT_ARG (); +if (get_u32 (&mcast_hash_max, *argv,0 )) +invarg ("invalid mcast_hash_max" , *argv); + +addattr32 (n,1024 ,IFLA_BR_MCAST_HASH_MAX , + mcast_hash_max); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -346,6 +356,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_HASH_ELASTICITY ])fprintf (f,"mcast_hash_elasticity %u " ,rta_getattr_u32 (tb[IFLA_BR_MCAST_HASH_ELASTICITY ])); + +if (tb[IFLA_BR_MCAST_HASH_MAX ]) +fprintf (f,"mcast_hash_max %u " , +rta_getattr_u32 (tb[IFLA_BR_MCAST_HASH_MAX ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 13/21 iplink: bridge: add support for IFLA_BR_MCAST_LAST_MEMBER_CNT
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_LAST_MEMBER_CNT attribute in iproute2 so it can change the last member count value.
--- ip/iplink_bridge.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ip/iplink_bridge.c +15 -0
@@ -39,6 +39,7 @@ static void print_explain(FILE *f)" [ mcast_querier MULTICAST_QUERIER ]\n" " [ mcast_hash_elasticity HASH_ELASTICITY ]\n" " [ mcast_hash_max HASH_MAX ]\n" +" [ mcast_last_member_count LAST_MEMBER_COUNT ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -199,6 +200,16 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,addattr32 (n,1024 ,IFLA_BR_MCAST_HASH_MAX , mcast_hash_max); + }else if (matches (*argv,"mcast_last_member_count" ) ==0 ) { +__u32 mcast_lmc; + +NEXT_ARG (); +if (get_u32 (&mcast_lmc, *argv,0 )) +invarg ("invalid mcast_last_member_count" , + *argv); + +addattr32 (n,1024 ,IFLA_BR_MCAST_LAST_MEMBER_CNT , + mcast_lmc); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -360,6 +371,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_HASH_MAX ])fprintf (f,"mcast_hash_max %u " ,rta_getattr_u32 (tb[IFLA_BR_MCAST_HASH_MAX ])); + +if (tb[IFLA_BR_MCAST_LAST_MEMBER_CNT ]) +fprintf (f,"mcast_last_member_count %u " , +rta_getattr_u32 (tb[IFLA_BR_MCAST_LAST_MEMBER_CNT ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 14/21 iplink: bridge: add support for IFLA_BR_MCAST_STARTUP_QUERY_CNT
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_STARTUP_QUERY_CNT attribute in iproute2 so it can change the startup query count.
--- ip/iplink_bridge.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ip/iplink_bridge.c +15 -0
@@ -40,6 +40,7 @@ static void print_explain(FILE *f)" [ mcast_hash_elasticity HASH_ELASTICITY ]\n" " [ mcast_hash_max HASH_MAX ]\n" " [ mcast_last_member_count LAST_MEMBER_COUNT ]\n" +" [ mcast_startup_query_count STARTUP_QUERY_COUNT ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -210,6 +211,16 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,addattr32 (n,1024 ,IFLA_BR_MCAST_LAST_MEMBER_CNT , mcast_lmc); + }else if (matches (*argv,"mcast_startup_query_count" ) ==0 ) { +__u32 mcast_sqc; + +NEXT_ARG (); +if (get_u32 (&mcast_sqc, *argv,0 )) +invarg ("invalid mcast_startup_query_count" , + *argv); + +addattr32 (n,1024 ,IFLA_BR_MCAST_STARTUP_QUERY_CNT , + mcast_sqc); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -375,6 +386,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_LAST_MEMBER_CNT ])fprintf (f,"mcast_last_member_count %u " ,rta_getattr_u32 (tb[IFLA_BR_MCAST_LAST_MEMBER_CNT ])); + +if (tb[IFLA_BR_MCAST_STARTUP_QUERY_CNT ]) +fprintf (f,"mcast_startup_query_count %u " , +rta_getattr_u32 (tb[IFLA_BR_MCAST_STARTUP_QUERY_CNT ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 15/21 iplink: bridge: add support for IFLA_BR_MCAST_LAST_MEMBER_INTVL
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_LAST_MEMBER_INTVL attribute in iproute2 so it can change the last member interval.
--- ip/iplink_bridge.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ip/iplink_bridge.c +15 -0
@@ -41,6 +41,7 @@ static void print_explain(FILE *f)" [ mcast_hash_max HASH_MAX ]\n" " [ mcast_last_member_count LAST_MEMBER_COUNT ]\n" " [ mcast_startup_query_count STARTUP_QUERY_COUNT ]\n" +" [ mcast_last_member_interval LAST_MEMBER_INTERVAL ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -221,6 +222,16 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,addattr32 (n,1024 ,IFLA_BR_MCAST_STARTUP_QUERY_CNT , mcast_sqc); + }else if (matches (*argv,"mcast_last_member_interval" ) ==0 ) { +__u64 mcast_last_member_intvl; + +NEXT_ARG (); +if (get_u64 (&mcast_last_member_intvl, *argv,0 )) +invarg ("invalid mcast_last_member_interval" , + *argv); + +addattr64 (n,1024 ,IFLA_BR_MCAST_LAST_MEMBER_INTVL , + mcast_last_member_intvl); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -390,6 +401,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_STARTUP_QUERY_CNT ])fprintf (f,"mcast_startup_query_count %u " ,rta_getattr_u32 (tb[IFLA_BR_MCAST_STARTUP_QUERY_CNT ])); + +if (tb[IFLA_BR_MCAST_LAST_MEMBER_INTVL ]) +fprintf (f,"mcast_last_member_interval %llu " , +rta_getattr_u64 (tb[IFLA_BR_MCAST_LAST_MEMBER_INTVL ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 16/21 iplink: bridge: add support for IFLA_BR_MCAST_MEMBERSHIP_INTVL
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_MEMBERSHIP_INTVL attribute in iproute2 so it can change the membership interval.
--- ip/iplink_bridge.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
ip/iplink_bridge.c +16 -0
@@ -42,6 +42,7 @@ static void print_explain(FILE *f)" [ mcast_last_member_count LAST_MEMBER_COUNT ]\n" " [ mcast_startup_query_count STARTUP_QUERY_COUNT ]\n" " [ mcast_last_member_interval LAST_MEMBER_INTERVAL ]\n" +" [ mcast_membership_interval MEMBERSHIP_INTERVAL ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -232,6 +233,17 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,addattr64 (n,1024 ,IFLA_BR_MCAST_LAST_MEMBER_INTVL , mcast_last_member_intvl); + }else if (matches (*argv,"mcast_membership_interval" ) ==0 ) { +__u64 mcast_membership_intvl; + +NEXT_ARG (); +if (get_u64 (&mcast_membership_intvl, *argv,0 )) { +invarg ("invalid mcast_membership_interval" , + *argv); +return -1 ; + } +addattr64 (n,1024 ,IFLA_BR_MCAST_MEMBERSHIP_INTVL , + mcast_membership_intvl); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -405,6 +417,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_LAST_MEMBER_INTVL ])fprintf (f,"mcast_last_member_interval %llu " ,rta_getattr_u64 (tb[IFLA_BR_MCAST_LAST_MEMBER_INTVL ])); + +if (tb[IFLA_BR_MCAST_MEMBERSHIP_INTVL ]) +fprintf (f,"mcast_membership_interval %llu " , +rta_getattr_u64 (tb[IFLA_BR_MCAST_MEMBERSHIP_INTVL ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 17/21 iplink: bridge: add support for IFLA_BR_MCAST_QUERIER_INTVL
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_QUERIER_INTVL attribute in iproute2 so it can change the querier interval.
--- ip/iplink_bridge.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
ip/iplink_bridge.c +16 -0
@@ -43,6 +43,7 @@ static void print_explain(FILE *f)" [ mcast_startup_query_count STARTUP_QUERY_COUNT ]\n" " [ mcast_last_member_interval LAST_MEMBER_INTERVAL ]\n" " [ mcast_membership_interval MEMBERSHIP_INTERVAL ]\n" +" [ mcast_querier_interval QUERIER_INTERVAL ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -244,6 +245,17 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, }addattr64 (n,1024 ,IFLA_BR_MCAST_MEMBERSHIP_INTVL , mcast_membership_intvl); + }else if (matches (*argv,"mcast_querier_interval" ) ==0 ) { +__u64 mcast_querier_intvl; + +NEXT_ARG (); +if (get_u64 (&mcast_querier_intvl, *argv,0 )) { +invarg ("invalid mcast_querier_interval" , + *argv); +return -1 ; + } +addattr64 (n,1024 ,IFLA_BR_MCAST_QUERIER_INTVL , + mcast_querier_intvl); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -421,6 +433,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_MEMBERSHIP_INTVL ])fprintf (f,"mcast_membership_interval %llu " ,rta_getattr_u64 (tb[IFLA_BR_MCAST_MEMBERSHIP_INTVL ])); + +if (tb[IFLA_BR_MCAST_QUERIER_INTVL ]) +fprintf (f,"mcast_querier_interval %llu " , +rta_getattr_u64 (tb[IFLA_BR_MCAST_QUERIER_INTVL ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 18/21 iplink: bridge: add support for IFLA_BR_MCAST_QUERY_INTVL
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_QUERY_INTVL attribute in iproute2 so it can change the query interval.
--- ip/iplink_bridge.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
ip/iplink_bridge.c +16 -0
@@ -44,6 +44,7 @@ static void print_explain(FILE *f)" [ mcast_last_member_interval LAST_MEMBER_INTERVAL ]\n" " [ mcast_membership_interval MEMBERSHIP_INTERVAL ]\n" " [ mcast_querier_interval QUERIER_INTERVAL ]\n" +" [ mcast_query_interval QUERY_INTERVAL ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -256,6 +257,17 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, }addattr64 (n,1024 ,IFLA_BR_MCAST_QUERIER_INTVL , mcast_querier_intvl); + }else if (matches (*argv,"mcast_query_interval" ) ==0 ) { +__u64 mcast_query_intvl; + +NEXT_ARG (); +if (get_u64 (&mcast_query_intvl, *argv,0 )) { +invarg ("invalid mcast_query_interval" , + *argv); +return -1 ; + } +addattr64 (n,1024 ,IFLA_BR_MCAST_QUERY_INTVL , + mcast_query_intvl); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -437,6 +449,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_QUERIER_INTVL ])fprintf (f,"mcast_querier_interval %llu " ,rta_getattr_u64 (tb[IFLA_BR_MCAST_QUERIER_INTVL ])); + +if (tb[IFLA_BR_MCAST_QUERY_INTVL ]) +fprintf (f,"mcast_query_interval %llu " , +rta_getattr_u64 (tb[IFLA_BR_MCAST_QUERY_INTVL ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 19/21 iplink: bridge: add support for IFLA_BR_MCAST_QUERY_RESPONSE_INTVL
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_QUERY_RESPONSE_INTVL attribute in iproute2 so it can change the query response interval.
--- ip/iplink_bridge.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
ip/iplink_bridge.c +16 -0
@@ -45,6 +45,7 @@ static void print_explain(FILE *f)" [ mcast_membership_interval MEMBERSHIP_INTERVAL ]\n" " [ mcast_querier_interval QUERIER_INTERVAL ]\n" " [ mcast_query_interval QUERY_INTERVAL ]\n" +" [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -268,6 +269,17 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, }addattr64 (n,1024 ,IFLA_BR_MCAST_QUERY_INTVL , mcast_query_intvl); + }else if (!matches (*argv,"mcast_query_response_interval" )) { +__u64 mcast_query_resp_intvl; + +NEXT_ARG (); +if (get_u64 (&mcast_query_resp_intvl, *argv,0 )) { +invarg ("invalid mcast_query_response_interval" , + *argv); +return -1 ; + } +addattr64 (n,1024 ,IFLA_BR_MCAST_QUERY_RESPONSE_INTVL , + mcast_query_resp_intvl); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -453,6 +465,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_QUERY_INTVL ])fprintf (f,"mcast_query_interval %llu " ,rta_getattr_u64 (tb[IFLA_BR_MCAST_QUERY_INTVL ])); + +if (tb[IFLA_BR_MCAST_QUERY_RESPONSE_INTVL ]) +fprintf (f,"mcast_query_response_interval %llu " , +rta_getattr_u64 (tb[IFLA_BR_MCAST_QUERY_RESPONSE_INTVL ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 20/21 iplink: bridge: add support for IFLA_BR_MCAST_STARTUP_QUERY_INTVL
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_MCAST_STARTUP_QUERY_INTVL attribute in iproute2 so it can change the startup query interval.
--- ip/iplink_bridge.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
ip/iplink_bridge.c +16 -0
@@ -46,6 +46,7 @@ static void print_explain(FILE *f)" [ mcast_querier_interval QUERIER_INTERVAL ]\n" " [ mcast_query_interval QUERY_INTERVAL ]\n" " [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n" +" [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -280,6 +281,17 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, }addattr64 (n,1024 ,IFLA_BR_MCAST_QUERY_RESPONSE_INTVL , mcast_query_resp_intvl); + }else if (!matches (*argv,"mcast_startup_query_interval" )) { +__u64 mcast_startup_query_intvl; + +NEXT_ARG (); +if (get_u64 (&mcast_startup_query_intvl, *argv,0 )) { +invarg ("invalid mcast_startup_query_interval" , + *argv); +return -1 ; + } +addattr64 (n,1024 ,IFLA_BR_MCAST_STARTUP_QUERY_INTVL , + mcast_startup_query_intvl); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -469,6 +481,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_QUERY_RESPONSE_INTVL ])fprintf (f,"mcast_query_response_interval %llu " ,rta_getattr_u64 (tb[IFLA_BR_MCAST_QUERY_RESPONSE_INTVL ])); + +if (tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL ]) +fprintf (f,"mcast_startup_query_interval %llu " , +rta_getattr_u64 (tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
PATCH v2 21/21 iplink: bridge: add support for netfilter call attributes
In reply to Nikolay AleksandrovFrom: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_NF_CALL_(IP|IP6|ARP)TABLES attributes in iproute2 so it can change their values.
--- ip/iplink_bridge.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
ip/iplink_bridge.c +45 -0
@@ -47,6 +47,9 @@ 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" +" [ nf_call_iptables NF_CALL_IPTABLES ]\n" +" [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n" +" [ nf_call_arptables NF_CALL_ARPTABLES ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" );
@@ -292,6 +295,36 @@ 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,"nf_call_iptables" ) ==0 ) { +__u8 nf_call_ipt; + +NEXT_ARG (); +if (get_u8 (&nf_call_ipt, *argv,0 )) { +invarg ("invalid nf_call_iptables" , *argv); +return -1 ; + } +addattr8 (n,1024 ,IFLA_BR_NF_CALL_IPTABLES , + nf_call_ipt); + }else if (matches (*argv,"nf_call_ip6tables" ) ==0 ) { +__u8 nf_call_ip6t; + +NEXT_ARG (); +if (get_u8 (&nf_call_ip6t, *argv,0 )) { +invarg ("invalid nf_call_ip6tables" , *argv); +return -1 ; + } +addattr8 (n,1024 ,IFLA_BR_NF_CALL_IP6TABLES , + nf_call_ip6t); + }else if (matches (*argv,"nf_call_arptables" ) ==0 ) { +__u8 nf_call_arpt; + +NEXT_ARG (); +if (get_u8 (&nf_call_arpt, *argv,0 )) { +invarg ("invalid nf_call_arptables" , *argv); +return -1 ; + } +addattr8 (n,1024 ,IFLA_BR_NF_CALL_ARPTABLES , + nf_call_arpt); }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -485,6 +518,18 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL ])fprintf (f,"mcast_startup_query_interval %llu " ,rta_getattr_u64 (tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL ])); + +if (tb[IFLA_BR_NF_CALL_IPTABLES ]) +fprintf (f,"nf_call_iptables %u " , +rta_getattr_u8 (tb[IFLA_BR_NF_CALL_IPTABLES ])); + +if (tb[IFLA_BR_NF_CALL_IP6TABLES ]) +fprintf (f,"nf_call_ip6tables %u " , +rta_getattr_u8 (tb[IFLA_BR_NF_CALL_IP6TABLES ])); + +if (tb[IFLA_BR_NF_CALL_ARPTABLES ]) +fprintf (f,"nf_call_arptables %u " , +rta_getattr_u8 (tb[IFLA_BR_NF_CALL_ARPTABLES ])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv,
Signature · 1 line
2.4.3
Pablo Neira Ayuso
maintainerRe: [PATCH iproute2 v2 21/21] iplink: bridge: add support for netfilter call attributes
Hi Nikolay,
Quoted 15 lines · Nikolay Aleksandrov
From: Nikolay Aleksandrov <[email protected]>
This patch implements support for the IFLA_BR_NF_CALL_(IP|IP6|ARP)TABLES attributes in iproute2 so it can change their values.
Signed-off-by Nikolay Aleksandrov <[email protected]>--- ip/iplink_bridge.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)ip/iplink_bridge.c +0
-0
ip/iplink_bridge.c static void print_explain(FILE *f) · line 52
Quoted 6 lines
ip/iplink_bridge.c +3
-0@@ -47,6 +47,9 @@ 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" +" [ nf_call_iptables NF_CALL_IPTABLES ]\n" +" [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n" +" [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
We will soon have conntrack support for bridge, that will help us kill this bridge_netfilter glue code that has caused us many headaches.
So I'd prefer not to give more exposition to this.