* [PATCH net] net: bridge: Bounce invalid boolopts
@ 2025-09-05 11:12 Petr Machata
2025-09-05 11:23 ` Nikolay Aleksandrov
2025-09-09 2:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Petr Machata @ 2025-09-05 11:12 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Simon Horman, Andrew Lunn, Nikolay Aleksandrov, Ido Schimmel,
bridge, Petr Machata, mlxsw
The bridge driver currently tolerates options that it does not recognize.
Instead, it should bounce them.
Fixes: a428afe82f98 ("net: bridge: add support for user-controlled bool options")
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
net/bridge/br.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 4bfaf543835a..512872a2ef81 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -346,6 +346,13 @@ int br_boolopt_multi_toggle(struct net_bridge *br,
int err = 0;
int opt_id;
+ opt_id = find_next_bit(&bitmap, BITS_PER_LONG, BR_BOOLOPT_MAX);
+ if (opt_id != BITS_PER_LONG) {
+ NL_SET_ERR_MSG_FMT_MOD(extack, "Unknown boolean option %d",
+ opt_id);
+ return -EINVAL;
+ }
+
for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
bool on = !!(bm->optval & BIT(opt_id));
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: bridge: Bounce invalid boolopts
2025-09-05 11:12 [PATCH net] net: bridge: Bounce invalid boolopts Petr Machata
@ 2025-09-05 11:23 ` Nikolay Aleksandrov
2025-09-09 2:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Aleksandrov @ 2025-09-05 11:23 UTC (permalink / raw)
To: Petr Machata, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev
Cc: Simon Horman, Andrew Lunn, Ido Schimmel, bridge, mlxsw
On 9/5/25 14:12, Petr Machata wrote:
> The bridge driver currently tolerates options that it does not recognize.
> Instead, it should bounce them.
>
> Fixes: a428afe82f98 ("net: bridge: add support for user-controlled bool options")
> Signed-off-by: Petr Machata <petrm@nvidia.com>
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>
> ---
> net/bridge/br.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/net/bridge/br.c b/net/bridge/br.c
> index 4bfaf543835a..512872a2ef81 100644
> --- a/net/bridge/br.c
> +++ b/net/bridge/br.c
> @@ -346,6 +346,13 @@ int br_boolopt_multi_toggle(struct net_bridge *br,
> int err = 0;
> int opt_id;
>
> + opt_id = find_next_bit(&bitmap, BITS_PER_LONG, BR_BOOLOPT_MAX);
> + if (opt_id != BITS_PER_LONG) {
> + NL_SET_ERR_MSG_FMT_MOD(extack, "Unknown boolean option %d",
> + opt_id);
> + return -EINVAL;
> + }
> +
> for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
> bool on = !!(bm->optval & BIT(opt_id));
>
IIRC at the time we did this was on purpose, the mask that is returned should
show which options were actually set without disrupting the call.
Anyway I'm ok with returning an error for such options as well, thanks!
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: bridge: Bounce invalid boolopts
2025-09-05 11:12 [PATCH net] net: bridge: Bounce invalid boolopts Petr Machata
2025-09-05 11:23 ` Nikolay Aleksandrov
@ 2025-09-09 2:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-09 2:50 UTC (permalink / raw)
To: Petr Machata
Cc: davem, edumazet, kuba, pabeni, netdev, horms, andrew, razor,
idosch, bridge, mlxsw
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 5 Sep 2025 13:12:33 +0200 you wrote:
> The bridge driver currently tolerates options that it does not recognize.
> Instead, it should bounce them.
>
> Fixes: a428afe82f98 ("net: bridge: add support for user-controlled bool options")
> Signed-off-by: Petr Machata <petrm@nvidia.com>
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>
>
> [...]
Here is the summary with links:
- [net] net: bridge: Bounce invalid boolopts
https://git.kernel.org/netdev/net/c/8625f5748fea
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] 3+ messages in thread
end of thread, other threads:[~2025-09-09 2:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 11:12 [PATCH net] net: bridge: Bounce invalid boolopts Petr Machata
2025-09-05 11:23 ` Nikolay Aleksandrov
2025-09-09 2:50 ` 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