diff mbox

[SRU,Trusty,1/1] neigh: fix setting of default gc_* values

Message ID 9ee84b00b0490fd109665939c5b164c2c59c5921.1478797030.git.joseph.salisbury@canonical.com
State New
Headers show

Commit Message

Joseph Salisbury Nov. 10, 2016, 5:06 p.m. UTC
From: Jiri Pirko <jiri@resnulli.us>

BugLink: http://bugs.launchpad.net/bugs/1634892

This patch fixes bug introduced by:
commit 1d4c8c29841b9991cdf3c7cc4ba7f96a94f104ca
"neigh: restore old behaviour of default parms values"

The thing is that in neigh_sysctl_register, extra1 and extra2 which were
previously set for NEIGH_VAR_GC_* are overwritten. That leads to
nonsense int limits for gc_* variables. So fix this by not touching
extra* fields for gc_* variables.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b194c1f1dbd5f2671e49e0ac801b1b78dc7de93b)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 net/core/neighbour.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Seth Forshee Nov. 10, 2016, 6:09 p.m. UTC | #1

Tim Gardner Nov. 11, 2016, 1:49 p.m. UTC | #2

diff mbox

Patch

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 8c1e03e..1329271 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -3037,7 +3037,7 @@  int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
 	if (!t)
 		goto err;
 
-	for (i = 0; i < ARRAY_SIZE(t->neigh_vars); i++) {
+	for (i = 0; i < NEIGH_VAR_GC_INTERVAL; i++) {
 		t->neigh_vars[i].data += (long) p;
 		t->neigh_vars[i].extra1 = dev;
 		t->neigh_vars[i].extra2 = p;