From: Roy Marples Date: Wed, 22 Jul 2015 09:59:32 +0000 (+0000) Subject: Backout commit [f20a30175f] as the behaviour can be trigged on Linux as well. X-Git-Tag: v6.9.2~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3823dbf55653d6cfad2a172a22ef061d3d766144;p=thirdparty%2Fdhcpcd.git Backout commit [f20a30175f] as the behaviour can be trigged on Linux as well. --- diff --git a/dhcp6.c b/dhcp6.c index 18dc74b3..dc6378f6 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -505,7 +505,6 @@ dhcp6_delegateaddr(struct in6_addr *addr, struct interface *ifp, return sla->prefix_len; } -#ifdef IGNORE_RA_NOPUBLICADDR int dhcp6_has_public_addr(const struct interface *ifp) { @@ -520,7 +519,6 @@ dhcp6_has_public_addr(const struct interface *ifp) } return 0; } -#endif static int dhcp6_makemessage(struct interface *ifp) @@ -3027,9 +3025,7 @@ recv: eloop_timeout_add_sec(ifp->ctx->eloop, (time_t)state->expire, dhcp6_startexpire, ifp); -#ifdef IGNORE_RA_NOPUBLICADDR ipv6nd_runignoredra(ifp); -#endif ipv6_addaddrs(&state->addrs); dhcp6_delegate_prefix(ifp); diff --git a/dhcp6.h b/dhcp6.h index 6752d643..d1a43723 100644 --- a/dhcp6.h +++ b/dhcp6.h @@ -238,6 +238,7 @@ const struct ipv6_addr *dhcp6_iffindaddr(const struct interface *ifp, struct ipv6_addr *dhcp6_findaddr(struct dhcpcd_ctx *, const struct in6_addr *, short); size_t dhcp6_find_delegates(struct interface *); +int dhcp6_has_public_addr(const struct interface *); int dhcp6_start(struct interface *, enum DH6S); void dhcp6_reboot(struct interface *); ssize_t dhcp6_env(char **, const char *, const struct interface *, @@ -248,10 +249,6 @@ void dhcp6_handleifa(struct dhcpcd_ctx *, int, const char *, int dhcp6_dadcompleted(const struct interface *); void dhcp6_drop(struct interface *, const char *); int dhcp6_dump(struct interface *); - -#ifdef IGNORE_RA_NOPUBLICADDR -int dhcp6_has_public_addr(const struct interface *); -#endif #else #define dhcp6_find_delegates(a) {} #define dhcp6_start(a, b) (0) diff --git a/dhcpcd.conf.5.in b/dhcpcd.conf.5.in index 3034e9ce..87488439 100644 --- a/dhcpcd.conf.5.in +++ b/dhcpcd.conf.5.in @@ -371,12 +371,9 @@ and/or user selection rather than the kernel. .It Ic ipv6ra_accept_nopublic Some IPv6 routers advertise themselves as a default router without any public prefixes or managed addresses. -On non Linux systems +Generally, this is incorrect behaviour and .Nm dhcpcd -will ignore the advertisement, -unless this option is turned on, -so that attempts to access a remote public IPv6 address without a local -public IPv6 address fail quickly. +will ignore the advertisement unless this option is turned on. .It Ic ipv6rs Enables IPv6 Router Advertisment solicitation. This is on by default, but is documented here in the case where it is disabled diff --git a/ipv6.c b/ipv6.c index 521f3c3e..73ccb881 100644 --- a/ipv6.c +++ b/ipv6.c @@ -745,7 +745,6 @@ ipv6_addaddr(struct ipv6_addr *ap, const struct timespec *now) return 0; } -#ifdef IGNORE_RA_NOPUBLICADDR int ipv6_publicaddr(const struct ipv6_addr *ia) { @@ -753,7 +752,6 @@ ipv6_publicaddr(const struct ipv6_addr *ia) (ia->addr.s6_addr[0] & 0xfe) != 0xfc && !(ia->addr_flags & IN6_IFF_NOTUSEABLE)); } -#endif int ipv6_findaddrmatch(const struct ipv6_addr *addr, const struct in6_addr *match, diff --git a/ipv6.h b/ipv6.h index 62726875..c7840ff2 100644 --- a/ipv6.h +++ b/ipv6.h @@ -104,16 +104,6 @@ #define IPV6_MANAGETEMPADDR #endif -/* NetBSD at least will try and contact a global address if there is a default - * route but there is no global address on the interface to connect with. - * As a safety measure, we ignore RA's until a public address is found. - * This is the wrong thing todo, as Linux seems to abort early - maybe - * because there is no matching source address for the destination address. - * Until this is resolved, we have this restriction in place. */ -#ifdef BSD -#define IGNORE_RA_NOPUBLICADDR -#endif - struct ipv6_addr { TAILQ_ENTRY(ipv6_addr) next; struct interface *iface; diff --git a/ipv6nd.c b/ipv6nd.c index 469446b8..03ae85f6 100644 --- a/ipv6nd.c +++ b/ipv6nd.c @@ -731,7 +731,6 @@ try_script: } } -#ifdef IGNORE_RA_NOPUBLICADDR static int ipv6nd_ra_has_public_addr(const struct ra *rap) { @@ -744,7 +743,6 @@ ipv6nd_ra_has_public_addr(const struct ra *rap) } return 0; } -#endif static void ipv6nd_handlera(struct dhcpcd_ctx *dctx, struct interface *ifp, @@ -1108,7 +1106,6 @@ ipv6nd_handlera(struct dhcpcd_ctx *dctx, struct interface *ifp, if (new_rap) add_router(ifp->ctx->ipv6, rap); -#ifdef IGNORE_RA_NOPUBLICADDR if (!ipv6nd_ra_has_public_addr(rap) && !(rap->iface->options->options & DHCPCD_IPV6RA_ACCEPT_NOPUBLIC) && (!(rap->flags & ND_RA_FLAG_MANAGED) || @@ -1122,8 +1119,6 @@ ipv6nd_handlera(struct dhcpcd_ctx *dctx, struct interface *ifp, rap->no_public_warned = 1; goto handle_flag; } -#endif - if (ifp->ctx->options & DHCPCD_TEST) { script_runreason(ifp, "TEST"); goto handle_flag; @@ -1171,7 +1166,6 @@ nodhcp6: ipv6nd_expirera(ifp); } -#ifdef IGNORE_RA_NOPUBLICADDR /* Run RA's we ignored becuase they had no public addresses * This should only be called when DHCPv6 applies a public address */ void @@ -1199,7 +1193,6 @@ ipv6nd_runignoredra(struct interface *ifp) } } } -#endif int ipv6nd_hasra(const struct interface *ifp) diff --git a/ipv6nd.h b/ipv6nd.h index 43707a21..ef01c554 100644 --- a/ipv6nd.h +++ b/ipv6nd.h @@ -110,16 +110,13 @@ ssize_t ipv6nd_free(struct interface *); void ipv6nd_expirera(void *arg); int ipv6nd_hasra(const struct interface *); int ipv6nd_hasradhcp(const struct interface *); +void ipv6nd_runignoredra(struct interface *); void ipv6nd_handleifa(struct dhcpcd_ctx *, int, const char *, const struct in6_addr *, int); int ipv6nd_dadcompleted(const struct interface *); void ipv6nd_expire(struct interface *, uint32_t); void ipv6nd_drop(struct interface *); void ipv6nd_neighbour(struct dhcpcd_ctx *, struct in6_addr *, int); - -#ifdef IGNORE_RA_NOPUBLICADDR -void ipv6nd_runignoredra(struct interface *); -#endif #else #define ipv6nd_startrs(a) {} #define ipv6nd_free(a) {}