]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Reset kernel RA flag correctly.
authorRoy Marples <roy@marples.name>
Tue, 4 Feb 2014 15:45:51 +0000 (15:45 +0000)
committerRoy Marples <roy@marples.name>
Tue, 4 Feb 2014 15:45:51 +0000 (15:45 +0000)
platform-bsd.c

index 8e0f813d85da62a2a362ee87d5e84942276bcd63..ea346ae50ea31256191abb82a691fb489417aa57 100644 (file)
@@ -89,11 +89,12 @@ inet6_sysctl(int code, int val, int action)
        return val;
 }
 
+static int kernel_ra_set;
 void
 restore_kernel_ra(void)
 {
 
-       if (options & DHCPCD_FORKED)
+       if (kernel_ra_set == 0 || options & DHCPCD_FORKED)
                return;
        syslog(LOG_INFO, "restoring Kernel IPv6 RA support");
        if (set_inet6_sysctl(IPV6CTL_ACCEPT_RTADV, 1) == -1)
@@ -142,6 +143,7 @@ check_ipv6(const char *ifname, int own)
                        return ra;
                }
                ra = 0;
+               kernel_ra_set = 1;
 
                /* Flush the kernel knowledge of advertised routers
                 * and prefixes so the kernel does not expire prefixes