]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Backout commit [f20a30175f] as the behaviour can be trigged on Linux as well.
authorRoy Marples <roy@marples.name>
Wed, 22 Jul 2015 09:59:32 +0000 (09:59 +0000)
committerRoy Marples <roy@marples.name>
Wed, 22 Jul 2015 09:59:32 +0000 (09:59 +0000)
dhcp6.c
dhcp6.h
dhcpcd.conf.5.in
ipv6.c
ipv6.h
ipv6nd.c
ipv6nd.h

diff --git a/dhcp6.c b/dhcp6.c
index 18dc74b3e4e3c95362ed9289847c6beab1e80bbe..dc6378f6dc9be644cacf885cdc1e287d4328205b 100644 (file)
--- 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 6752d643edd93a16b65e96607d6c1565f645c996..d1a4372329fe620cbb6e2a0d5740fc463ab535a5 100644 (file)
--- 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)
index 3034e9ce9f044e37326e6a572c3606027133dd00..87488439f5235648d238c62661a6decccaed72bb 100644 (file)
@@ -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 521f3c3ee7690c5942d9b3fd106bc9b50f517287..73ccb8813ed384a548f3120dec4ce6ad8a32e29f 100644 (file)
--- 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 62726875b09cf571ea487f4467e9e712ff0a7aca..c7840ff2642934b19fd2359b4f677814020fdef9 100644 (file)
--- a/ipv6.h
+++ b/ipv6.h
 #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;
index 469446b86975c7c70f14be49dab984f2dc682358..03ae85f616c1ffe098ea8ed15262f3a5796f5a02 100644 (file)
--- 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)
index 43707a21bd1c321cda973916057121e0f6a7366d..ef01c554c2342b2c8499b4798227cb73a2bd4ec0 100644 (file)
--- 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) {}