]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Ignore the RA if there are no public addresses on the interface.
authorRoy Marples <roy@marples.name>
Wed, 22 Jul 2015 10:07:39 +0000 (10:07 +0000)
committerRoy Marples <roy@marples.name>
Wed, 22 Jul 2015 10:07:39 +0000 (10:07 +0000)
Fixes [f44b3b4817].

ipv6nd.c

index 03ae85f616c1ffe098ea8ed15262f3a5796f5a02..c893d761988df63e8b792c4f3b113178ac9593b8 100644 (file)
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -732,14 +732,19 @@ try_script:
 }
 
 static int
-ipv6nd_ra_has_public_addr(const struct ra *rap)
+ipv6nd_has_public_addr(const struct interface *ifp)
 {
+       const struct ra *rap;
        const struct ipv6_addr *ia;
 
-       TAILQ_FOREACH(ia, &rap->addrs, next) {
-               if (ia->flags & IPV6_AF_AUTOCONF &&
-                   ipv6_publicaddr(ia))
-                       return 1;
+       TAILQ_FOREACH(rap, ifp->ctx->ipv6->ra_routers, next) {
+               if (rap->iface == ifp) {
+                       TAILQ_FOREACH(ia, &rap->addrs, next) {
+                               if (ia->flags & IPV6_AF_AUTOCONF &&
+                                   ipv6_publicaddr(ia))
+                                       return 1;
+                       }
+               }
        }
        return 0;
 }
@@ -1106,7 +1111,7 @@ ipv6nd_handlera(struct dhcpcd_ctx *dctx, struct interface *ifp,
        if (new_rap)
                add_router(ifp->ctx->ipv6, rap);
 
-       if (!ipv6nd_ra_has_public_addr(rap) &&
+       if (!ipv6nd_has_public_addr(rap->iface) &&
            !(rap->iface->options->options & DHCPCD_IPV6RA_ACCEPT_NOPUBLIC) &&
            (!(rap->flags & ND_RA_FLAG_MANAGED) ||
            !dhcp6_has_public_addr(rap->iface)))