From dccebe204fd522c1e78513ba0b05d291ae88ed8d Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 18 May 2023 12:27:10 +0100 Subject: [PATCH] Linux: fix disabling of kernel RA autoconf Well, that was a big whups leaving it turned on. Thanks to Klaus Frank for the spot. Fixes #176. --- src/if-linux.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/if-linux.c b/src/if-linux.c index 3ca96705..f2f609ed 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -2139,7 +2139,12 @@ if_setup_inet6(const struct interface *ifp) snprintf(path, sizeof(path), "%s/%s/autoconf", p_conf, ifp->name); ra = check_proc_int(ctx, path); - if (ra != 1 && ra != -1) { + if (ra == -1) { + /* The sysctl probably doesn't exist, but this isn't an + * error as such so just log it and continue */ + if (errno != ENOENT) + logerr("%s: %s", __func__, path); + } else if (ra != 0) { if (if_writepathuint(ctx, path, 0) == -1) logerr("%s: %s", __func__, path); } -- 2.47.2