net/ipv6: skip_notify_on_dev_down fix
Subsystems (3)
cover net/ipv6: skip_notify_on_dev_down fix
While reviewing Matthieu Baerts recent patch [1], I found it copied/pasted an existing bug around skip_notify_on_dev_down.
First patch is a stable candidate, and second one can simply land in net tree.
Eric Dumazet (2):
net/ipv6: fix bool/int mismatch for skip_notify_on_dev_down net/ipv6: convert skip_notify_on_dev_down sysctl to u8
include/net/netns/ipv6.h | 2 +- net/ipv6/route.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.41.0.rc0.172.g3f132b7071-goog
PATCH 1/2 net/ipv6: fix bool/int mismatch for skip_notify_on_dev_down
skip_notify_on_dev_down ctl table expects this field to be an int (4 bytes), not a bool (1 byte).
Because proc_dou8vec_minmax() was added in 5.13, this patch converts skip_notify_on_dev_down to an int.
Following patch then converts the field to u8 and use proc_dou8vec_minmax().
--- include/net/netns/ipv6.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/netns/ipv6.h +1 -1
@@ -53,7 +53,7 @@ struct netns_sysctl_ipv6 {int seg6_flowlabel;u32 ioam6_id;u64 ioam6_id_wide; -bool skip_notify_on_dev_down; +int skip_notify_on_dev_down;u8 fib_notify_on_flag_change;u8 icmpv6_error_anycast_as_unicast; };
Signature · 1 line
2.41.0.rc0.172.g3f132b7071-goog
Re: [PATCH net 1/2] net/ipv6: fix bool/int mismatch for skip_notify_on_dev_down
Quoted 6 lines · Eric Dumazet
skip_notify_on_dev_downctl table expects this field to be an int (4 bytes), not a bool (1 byte).Because
proc_dou8vec_minmax()was added in 5.13, this patch convertsskip_notify_on_dev_downto an int.
Quoted 9 lines
Following patch then converts the field to u8 and use
proc_dou8vec_minmax().Fixes 7c6bb7d2faaf ("net/ipv6: Add knob to skip DELROUTE message on device down")Signed-off-by Eric Dumazet <[email protected]>Cc David Ahern <[email protected]>--- include/net/netns/ipv6.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 2/2 net/ipv6: convert skip_notify_on_dev_down sysctl to u8
In reply to Eric DumazetSave a bit a space, and could help future sysctls to use the same pattern.
--- include/net/netns/ipv6.h | 2 +- net/ipv6/route.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
include/net/netns/ipv6.h +1 -1
@@ -53,7 +53,7 @@ struct netns_sysctl_ipv6 {int seg6_flowlabel;u32 ioam6_id;u64 ioam6_id_wide; -int skip_notify_on_dev_down; +u8 skip_notify_on_dev_down;u8 fib_notify_on_flag_change;u8 icmpv6_error_anycast_as_unicast; };
net/ipv6/route.c +2 -2
@@ -6412,9 +6412,9 @@ static struct ctl_table ipv6_route_table_template[] = { { .procname = "skip_notify_on_dev_down", .data = &init_net.ipv6.sysctl.skip_notify_on_dev_down, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec_minmax, + .proc_handler = proc_dou8vec_minmax, .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, },
Signature · 1 line
2.41.0.rc0.172.g3f132b7071-goog
Re: [PATCH net 2/2] net/ipv6: convert skip_notify_on_dev_down sysctl to u8
Quoted 10 lines · Eric Dumazet
Save a bit a space, and could help future sysctls to use the same pattern.
Signed-off-by Eric Dumazet <[email protected]>Cc David Ahern <[email protected]>--- include/net/netns/ipv6.h | 2 +- net/ipv6/route.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Hi Eric,
Quoted 2 lines · Eric Dumazet
While reviewing Matthieu Baerts recent patch [1], I found it copied/pasted an existing bug around
skip_notify_on_dev_down.
Good catch! Indeed, I quickly copied/pasted the code around skip_notify_on_dev_down to create my RFC without looking for possible issues in the code.
Quoted 8 lines
First patch is a stable candidate, and second one can simply land in net tree.
Eric Dumazet (2):
net/ipv6: fix bool/int mismatch forskip_notify_on_dev_downnet/ipv6: convertskip_notify_on_dev_downsysctl to u8
Thank you for the patches and for having cced me! The modifications look good to me!
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 1 Jun 2023 16:04:43 +0000 you wrote:
While reviewing Matthieu Baerts recent patch [1], I found it copied/pasted an existing bug around
skip_notify_on_dev_down.First patch is a stable candidate, and second one can simply land in net tree.
[...]
Here is the summary with links:
- [net,1/2] net/ipv6: fix bool/int mismatch for skip_notify_on_dev_down
https://git.kernel.org/netdev/net/c/edf2e1d2019b - [net,2/2] net/ipv6: convert skip_notify_on_dev_down sysctl to u8 https://git.kernel.org/netdev/net/c/ef62c0ae6db1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html