Skip to contentSkip to conversation

ipv6: Fix sysctl max for fib_multipath_hash_policy

PATCH In review Ido Schimmel 3 participants 3 messages Sep 2, 2020

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

PATCH 1/1 ipv6: Fix sysctl max for fib_multipath_hash_policy

From: Ido Schimmel <[email protected]>

Cited commit added the possible value of '2', but it cannot be set. Fix it by adjusting the maximum value to '2'. This is consistent with the corresponding IPv4 sysctl.

Before:

# sysctl -w net.ipv6.fib_multipath_hash_policy=2
sysctl: setting key "net.ipv6.fib_multipath_hash_policy": Invalid argument
net.ipv6.fib_multipath_hash_policy = 2
# sysctl net.ipv6.fib_multipath_hash_policy
net.ipv6.fib_multipath_hash_policy = 0

After:

# sysctl -w net.ipv6.fib_multipath_hash_policy=2
net.ipv6.fib_multipath_hash_policy = 2
# sysctl net.ipv6.fib_multipath_hash_policy
net.ipv6.fib_multipath_hash_policy = 2
Fixes d8f74f0975d8 ("ipv6: Support multipath hashing on inner IP pkts")
---
 net/ipv6/sysctl_net_ipv6.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/sysctl_net_ipv6.c +2 -1
index fac2135aa47b..5b60a4bdd36a 100644
@@ -21,6 +21,7 @@
 #include <net/calipso.h>
 #endif
 
+static int two = 2;
 static int flowlabel_reflect_max = 0x7;
 static int auto_flowlabels_min;
 static int auto_flowlabels_max = IP6_AUTO_FLOW_LABEL_MAX;
@@ -150,7 +151,7 @@ static struct ctl_table ipv6_table_template[] = {
 		.mode		= 0644,
 		.proc_handler   = proc_rt6_multipath_hash_policy,
 		.extra1		= SYSCTL_ZERO,
-		.extra2		= SYSCTL_ONE,
+		.extra2		= &two,
 	},
 	{
 		.procname	= "seg6_flowlabel",
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 51 lines · Ido Schimmel

From: Ido Schimmel <[email protected]>

Cited commit added the possible value of '2', but it cannot be set. Fix it by adjusting the maximum value to '2'. This is consistent with the corresponding IPv4 sysctl.

Before:

# sysctl -w net.ipv6.fib_multipath_hash_policy=2
sysctl: setting key "net.ipv6.fib_multipath_hash_policy": Invalid argument
net.ipv6.fib_multipath_hash_policy = 2
# sysctl net.ipv6.fib_multipath_hash_policy
net.ipv6.fib_multipath_hash_policy = 0

After:

# sysctl -w net.ipv6.fib_multipath_hash_policy=2
net.ipv6.fib_multipath_hash_policy = 2
# sysctl net.ipv6.fib_multipath_hash_policy
net.ipv6.fib_multipath_hash_policy = 2
Fixes d8f74f0975d8 ("ipv6: Support multipath hashing on inner IP pkts")
---
 net/ipv6/sysctl_net_ipv6.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/sysctl_net_ipv6.c +2 -1
index fac2135aa47b..5b60a4bdd36a 100644
@@ -21,6 +21,7 @@
 #include <net/calipso.h>
 #endif
 
+static int two = 2;
 static int flowlabel_reflect_max = 0x7;
 static int auto_flowlabels_min;
 static int auto_flowlabels_max = IP6_AUTO_FLOW_LABEL_MAX;
@@ -150,7 +151,7 @@ static struct ctl_table ipv6_table_template[] = {
 		.mode		= 0644,
 		.proc_handler   = proc_rt6_multipath_hash_policy,
 		.extra1		= SYSCTL_ZERO,
-		.extra2		= SYSCTL_ONE,
+		.extra2		= &two,
 	},
 	{
 		.procname	= "seg6_flowlabel",
Signature · 1 line
2.26.2

Thanks for catching.

maintainer
#2 lore raw
In reply to Ido Schimmel

From: Ido Schimmel <[email protected]>
Date: Wed, 2 Sep 2020 16:16:59 +0300

Quoted 16 lines

From: Ido Schimmel <[email protected]>

Cited commit added the possible value of '2', but it cannot be set. Fix it by adjusting the maximum value to '2'. This is consistent with the corresponding IPv4 sysctl.

Before:

# sysctl -w net.ipv6.fib_multipath_hash_policy=2
sysctl: setting key "net.ipv6.fib_multipath_hash_policy": Invalid argument
net.ipv6.fib_multipath_hash_policy = 2
# sysctl net.ipv6.fib_multipath_hash_policy
net.ipv6.fib_multipath_hash_policy = 0

After:

Quoted 7 lines
# sysctl -w net.ipv6.fib_multipath_hash_policy=2
net.ipv6.fib_multipath_hash_policy = 2
# sysctl net.ipv6.fib_multipath_hash_policy
net.ipv6.fib_multipath_hash_policy = 2
Fixes d8f74f0975d8 ("ipv6: Support multipath hashing on inner IP pkts")

Wow, how was this mode even tested...

Applied and queued up for -stable, thanks.