]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Linux: fix disabling of kernel RA autoconf
authorRoy Marples <roy@marples.name>
Thu, 18 May 2023 11:27:10 +0000 (12:27 +0100)
committerRoy Marples <roy@marples.name>
Thu, 18 May 2023 11:27:10 +0000 (12:27 +0100)
Well, that was a big whups leaving it turned on.
Thanks to Klaus Frank for the spot.
Fixes #176.

src/if-linux.c

index 3ca967055d5d6cda2f228efd38dc564daecfb33d..f2f609ed56da55756242ab72ce5ff955b64c4ffe 100644 (file)
@@ -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);
        }