]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Remove the IPv6 forwarding router check as valid use cases exist
authorRoy Marples <roy@marples.name>
Wed, 2 Oct 2013 08:00:09 +0000 (08:00 +0000)
committerRoy Marples <roy@marples.name>
Wed, 2 Oct 2013 08:00:09 +0000 (08:00 +0000)
where you would want IPv6 RS/RA on a router.

platform-bsd.c
platform-linux.c

index 0ae5ca60597c69bce24253a32de7bf9e6ffff6d1..ab97199fe1aa3d4fdc1dcf3eed32eefc1dcda777 100644 (file)
@@ -121,8 +121,8 @@ ipv6_ra_flush(void)
 int
 check_ipv6(const char *ifname, int own)
 {
-       static int set_restore = 0, forward_warned = 0, global_ra = 0;
-       int ra, forward;
+       static int set_restore = 0, global_ra = 0;
+       int ra;
 
        /* BSD doesn't support these values per iface, so just return
         * the global ra setting */
@@ -150,20 +150,6 @@ check_ipv6(const char *ifname, int own)
        if (ifname == NULL)
                global_ra = ra;
 
-       if (!forward_warned) {
-               forward = get_inet6_sysctl(IPV6CTL_FORWARDING);
-               if (forward == -1)
-                       /* The sysctl probably doesn't exist, but this isn't an
-                        * error as such so just log it and continue */
-                       syslog(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
-                           "IPV6CTL_FORWARDING: %m");
-               else if (forward != 0) {
-                       forward_warned = 1;
-                       syslog(LOG_WARNING,
-                           "Kernel is configured as a router, not a host");
-               }
-       }
-
        /* Flush the kernel knowledge of advertised routers */
        ipv6_ra_flush();
 
index ba275b5edda7633ae5e43fd144cb0bec1b4ad2e0..e0fe87e63be6e9bf66d86dca2cef061237e21223 100644 (file)
@@ -179,7 +179,7 @@ int
 check_ipv6(const char *ifname, int own)
 {
        static int ipv6_checked = 0;
-       int ra, forward, ex, i;
+       int ra, ex, i;
        char path[256], *p, **nrest;
 
        if (ifname == NULL) {
@@ -220,13 +220,13 @@ check_ipv6(const char *ifname, int own)
                        p = strdup(ifname);
                        if (p == NULL) {
                                syslog(LOG_ERR, "%s: %m", __func__);
-                               goto forward;
+                               return ra;
                        }
                        nrest = realloc(restore,
                            (nrestore + 1) * sizeof(char *));
                        if (nrest == NULL) {
                                syslog(LOG_ERR, "%s: %m", __func__);
-                               goto forward;
+                               return ra;
                        }
                        restore = nrest;
                        restore[nrestore++] = p;
@@ -236,22 +236,6 @@ check_ipv6(const char *ifname, int own)
                        atexit(restore_kernel_ra);
        }
 
-forward:
-       if (ra != 2) {
-               snprintf(path, sizeof(path), "%s/%s/forwarding",
-                   prefix, ifname);
-               forward = check_proc_int(path);
-               if (forward == -1) {
-                       /* The sysctl probably doesn't exist, but this isn't an
-                        * error as such so just log it and continue */
-                       syslog(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
-                           "%s: %m", path);
-               } else if (forward != 0) {
-                       syslog(LOG_WARNING,
-                           "%s: configured as a router, not a host", ifname);
-                       return 0;
-               }
-       }
        return ra;
 }