Skip to contentSkip to conversation

net/ipv6: skip_notify_on_dev_down fix

PATCH Applied Eric Dumazet 4 participants 7 messages Jun 1, 2023 – Jun 3, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

https://lore.kernel.org/lkml/20230601-net-next-skip_print_link_becomes_ready-v1-1-c13e64c14095@tessares.net/

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
#1 lore raw

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().

Fixes 7c6bb7d2faaf ("net/ipv6: Add knob to skip DELROUTE message on device down")
Cc David Ahern <[email protected]>
---
 include/net/netns/ipv6.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/netns/ipv6.h +1 -1
index 3cceb3e9320b9c614026846a451676edf766e4d3..d44b2ee49698fa17bef0c54df8c960ec5addcbd0 100644
@@ -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
maintainer Reviewed-by on v1 1/2
#2 lore raw

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_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.

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")
Cc David Ahern <[email protected]>
---
 include/net/netns/ipv6.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#3 lore raw

PATCH 2/2 net/ipv6: convert skip_notify_on_dev_down sysctl to u8

In reply to Eric Dumazet

Save 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
index d44b2ee49698fa17bef0c54df8c960ec5addcbd0..5f2cfd84570aea8dd225208d36065b47b27b6b10 100644
@@ -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
index e3aec46bd4662160d684999c4696daa6b451da90..392aaa373b6671e3f0f9e04f3fa7f4363a06dadb 100644
@@ -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
Acked-by on the v1 series
#5 lore raw
In reply to Eric Dumazet

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.

https://lore.kernel.org/lkml/20230601-net-next-skip_print_link_becomes_ready-v1-1-c13e64c14095@tessares.net/

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

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
#6 lore raw
In reply to Eric Dumazet
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.

https://lore.kernel.org/lkml/20230601-net-next-skip_print_link_becomes_ready-v1-1-c13e64c14095@tessares.net/

[...]

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