Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast querier state
@ 2021-08-16 10:11 Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 1/3] net: bridge: mcast: don't dump querier state if snooping is disabled Nikolay Aleksandrov
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Nikolay Aleksandrov @ 2021-08-16 10:11 UTC (permalink / raw)
To: netdev; +Cc: roopa, bridge, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@nvidia.com>
Hi,
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.
Thanks,
Nik
Nikolay Aleksandrov (3):
net: bridge: mcast: don't dump querier state if snooping is disabled
net: bridge: mcast: drop sizeof for nest attribute's zero size
net: bridge: mcast: account for ipv6 size when dumping querier state
net/bridge/br_multicast.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
--
2.31.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net-next 1/3] net: bridge: mcast: don't dump querier state if snooping is disabled
2021-08-16 10:11 [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast querier state Nikolay Aleksandrov
@ 2021-08-16 10:11 ` Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 2/3] net: bridge: mcast: drop sizeof for nest attribute's zero size Nikolay Aleksandrov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Nikolay Aleksandrov @ 2021-08-16 10:11 UTC (permalink / raw)
To: netdev; +Cc: roopa, bridge, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@nvidia.com>
A minor improvement to avoid dumping mcast ctx querier state if snooping
is disabled for that context (either bridge or vlan).
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
---
net/bridge/br_multicast.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 0e5d6ba03457..9bdf12635871 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -2943,6 +2943,10 @@ int br_multicast_dump_querier_state(struct sk_buff *skb,
struct net_bridge_port *p;
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);
if (!nest)
return -EMSGSIZE;
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next 2/3] net: bridge: mcast: drop sizeof for nest attribute's zero size
2021-08-16 10:11 [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast querier state Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 1/3] net: bridge: mcast: don't dump querier state if snooping is disabled Nikolay Aleksandrov
@ 2021-08-16 10:11 ` Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 3/3] net: bridge: mcast: account for ipv6 size when dumping querier state Nikolay Aleksandrov
2021-08-16 13:10 ` [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast " patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Nikolay Aleksandrov @ 2021-08-16 10:11 UTC (permalink / raw)
To: netdev
Cc: roopa, bridge, Nikolay Aleksandrov, kernel test robot, Dan Carpenter
From: Nikolay Aleksandrov <nikolay@nvidia.com>
This was a dumb error I made instead of writing nla_total_size(0)
for a nest attribute, I wrote nla_total_size(sizeof(0)).
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 606433fe3e11 ("net: bridge: mcast: dump ipv4 querier state")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
---
net/bridge/br_multicast.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 9bdf12635871..76992ddac7e0 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -2928,7 +2928,7 @@ __br_multicast_get_querier_port(struct net_bridge *br,
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(int)) + /* BRIDGE_QUERIER_IP_PORT */
nla_total_size_64bit(sizeof(u64)); /* BRIDGE_QUERIER_IP_OTHER_TIMER */
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next 3/3] net: bridge: mcast: account for ipv6 size when dumping querier state
2021-08-16 10:11 [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast querier state Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 1/3] net: bridge: mcast: don't dump querier state if snooping is disabled Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 2/3] net: bridge: mcast: drop sizeof for nest attribute's zero size Nikolay Aleksandrov
@ 2021-08-16 10:11 ` Nikolay Aleksandrov
2021-08-16 13:10 ` [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast " patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Nikolay Aleksandrov @ 2021-08-16 10:11 UTC (permalink / raw)
To: netdev; +Cc: roopa, bridge, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@nvidia.com>
We need to account for the IPv6 attributes when dumping querier state.
Fixes: 5e924fe6ccfd ("net: bridge: mcast: dump ipv6 querier state")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
---
net/bridge/br_multicast.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 76992ddac7e0..e411dd814c58 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -2931,7 +2931,13 @@ size_t br_multicast_querier_state_size(void)
return nla_total_size(0) + /* nest attribute */
nla_total_size(sizeof(__be32)) + /* BRIDGE_QUERIER_IP_ADDRESS */
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 */
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast querier state
2021-08-16 10:11 [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast querier state Nikolay Aleksandrov
` (2 preceding siblings ...)
2021-08-16 10:11 ` [PATCH net-next 3/3] net: bridge: mcast: account for ipv6 size when dumping querier state Nikolay Aleksandrov
@ 2021-08-16 13:10 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-16 13:10 UTC (permalink / raw)
To: Nikolay Aleksandrov; +Cc: netdev, roopa, bridge, nikolay
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Mon, 16 Aug 2021 13:11:31 +0300 you wrote:
> From: Nikolay Aleksandrov <nikolay@nvidia.com>
>
> Hi,
> 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.
>
> [...]
Here is the summary with links:
- [net-next,1/3] net: bridge: mcast: don't dump querier state if snooping is disabled
https://git.kernel.org/netdev/net-next/c/f137b7d4ecf8
- [net-next,2/3] net: bridge: mcast: drop sizeof for nest attribute's zero size
https://git.kernel.org/netdev/net-next/c/cdda378bd8d9
- [net-next,3/3] net: bridge: mcast: account for ipv6 size when dumping querier state
https://git.kernel.org/netdev/net-next/c/175e66924719
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-16 13:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 10:11 [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast querier state Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 1/3] net: bridge: mcast: don't dump querier state if snooping is disabled Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 2/3] net: bridge: mcast: drop sizeof for nest attribute's zero size Nikolay Aleksandrov
2021-08-16 10:11 ` [PATCH net-next 3/3] net: bridge: mcast: account for ipv6 size when dumping querier state Nikolay Aleksandrov
2021-08-16 13:10 ` [PATCH net-next 0/3] net: bridge: mcast: fixes for mcast " patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).