From: Roy Marples Date: Wed, 2 Oct 2013 08:00:09 +0000 (+0000) Subject: Remove the IPv6 forwarding router check as valid use cases exist X-Git-Tag: v6.2.0~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40db5d83881a610f443fd5b489bea7ee8169d71a;p=thirdparty%2Fdhcpcd.git Remove the IPv6 forwarding router check as valid use cases exist where you would want IPv6 RS/RA on a router. --- diff --git a/platform-bsd.c b/platform-bsd.c index 0ae5ca60..ab97199f 100644 --- a/platform-bsd.c +++ b/platform-bsd.c @@ -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(); diff --git a/platform-linux.c b/platform-linux.c index ba275b5e..e0fe87e6 100644 --- a/platform-linux.c +++ b/platform-linux.c @@ -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; }