summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
authorAlin Năstac <alin.nastac@gmail.com>2017-08-17 14:12:05 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-08-17 18:35:51 +0200
commite627542ee5763b6810bf3f7e64e151a0326922aa (patch)
tree012d3a99bfc99041c2301878f69d85901d6754ed /system-linux.c
parente41382c92e9e83ad754a060e63efa43c753095f1 (diff)
netifd: allow negative neighlocktime values
When -1 is written in /proc/sys/net/ipv4/neigh/<iface>/locktime, kernel disables ARP trashing protection. A value of 0 does not completely disable this protection, a second ARP update being discarded if it is processed during the same jiffie as the first update. Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/system-linux.c b/system-linux.c
index f38aaed..02faa32 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1362,7 +1362,7 @@ system_if_get_settings(struct device *dev, struct device_settings *s)
}
if (!system_get_neigh4locktime(dev, buf, sizeof(buf))) {
- s->neigh4locktime = strtoul(buf, NULL, 0);
+ s->neigh4locktime = strtol(buf, NULL, 0);
s->flags |= DEV_OPT_NEIGHLOCKTIME;
}
@@ -1476,7 +1476,7 @@ system_if_apply_settings(struct device *dev, struct device_settings *s, unsigned
system_set_neigh6reachabletime(dev, buf);
}
if (s->flags & DEV_OPT_NEIGHLOCKTIME & apply_mask) {
- snprintf(buf, sizeof(buf), "%u", s->neigh4locktime);
+ snprintf(buf, sizeof(buf), "%d", s->neigh4locktime);
system_set_neigh4locktime(dev, buf);
}
if (s->flags & DEV_OPT_NEIGHGCSTALETIME & apply_mask) {