[LEDE-DEV] [PATCH] netifd: allow negative neighlocktime values
Hans Dedecker
dedeckeh at gmail.com
Thu Aug 17 05:03:29 PDT 2017
On Thu, Aug 17, 2017 at 1:27 PM, Alin Nastac <alin.nastac at gmail.com> wrote:
> When -1 is written in /proc/sys/net/ipv4/neigh/<iface>/locktime,
If the locktime proc file accepts a negative value it makes sense to
change the type of neigh4locktime from unsigned integer to integer.
This will avoid cppcheck flagging this again as an issue.
Hans
> 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 at gmail.com>
> ---
> system-linux.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/system-linux.c b/system-linux.c
> index 483a98d..0bdc53d 100644
> --- a/system-linux.c
> +++ b/system-linux.c
> @@ -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) {
> --
> 2.7.4
>
More information about the Lede-dev
mailing list