Commit ab636138 authored by David S. Miller's avatar David S. Miller

Merge branch 'bridge-mcast-fixes'

Nikolay Aleksandrov says:

====================
net: bridge: mcast: fixes for mcast querier state

These three fix querier state dumping. The first patch can be considered
a minor behaviour improvement, it avoids dumping querier state when mcast
snooping is disabled. The second patch was a report of sizeof(0) used
for nested netlink attribute size which should be just 0, and the third
patch accounts for IPv6 querier state size when allocating skb for
notifications.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 23a44b77 175e6692
...@@ -2928,10 +2928,16 @@ __br_multicast_get_querier_port(struct net_bridge *br, ...@@ -2928,10 +2928,16 @@ __br_multicast_get_querier_port(struct net_bridge *br,
size_t br_multicast_querier_state_size(void) size_t br_multicast_querier_state_size(void)
{ {
return nla_total_size(sizeof(0)) + /* nest attribute */ return nla_total_size(0) + /* nest attribute */
nla_total_size(sizeof(__be32)) + /* BRIDGE_QUERIER_IP_ADDRESS */ nla_total_size(sizeof(__be32)) + /* BRIDGE_QUERIER_IP_ADDRESS */
nla_total_size(sizeof(int)) + /* BRIDGE_QUERIER_IP_PORT */ nla_total_size(sizeof(int)) + /* BRIDGE_QUERIER_IP_PORT */
nla_total_size_64bit(sizeof(u64)); /* BRIDGE_QUERIER_IP_OTHER_TIMER */ nla_total_size_64bit(sizeof(u64)) + /* BRIDGE_QUERIER_IP_OTHER_TIMER */
#if IS_ENABLED(CONFIG_IPV6)
nla_total_size(sizeof(struct in6_addr)) + /* BRIDGE_QUERIER_IPV6_ADDRESS */
nla_total_size(sizeof(int)) + /* BRIDGE_QUERIER_IPV6_PORT */
nla_total_size_64bit(sizeof(u64)) + /* BRIDGE_QUERIER_IPV6_OTHER_TIMER */
#endif
0;
} }
/* protected by rtnl or rcu */ /* protected by rtnl or rcu */
...@@ -2943,6 +2949,10 @@ int br_multicast_dump_querier_state(struct sk_buff *skb, ...@@ -2943,6 +2949,10 @@ int br_multicast_dump_querier_state(struct sk_buff *skb,
struct net_bridge_port *p; struct net_bridge_port *p;
struct nlattr *nest; struct nlattr *nest;
if (!br_opt_get(brmctx->br, BROPT_MULTICAST_ENABLED) ||
br_multicast_ctx_vlan_global_disabled(brmctx))
return 0;
nest = nla_nest_start(skb, nest_attr); nest = nla_nest_start(skb, nest_attr);
if (!nest) if (!nest)
return -EMSGSIZE; return -EMSGSIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment