}
struct ipv6_addr *
-ipv6_ifanyglobal(struct interface *ifp)
+ipv6_anyglobal(struct interface *sifp)
{
+ struct interface *ifp;
struct ipv6_state *state;
struct ipv6_addr *ia;
- if (ifp->carrier == LINK_DOWN)
- return NULL;
-
- state = IPV6_STATE(ifp);
- if (state == NULL)
- return NULL;
+ TAILQ_FOREACH(ifp, sifp->ctx->ifaces, next) {
+ if (ifp != sifp && ip6_forwarding(ifp->name) != 1)
+ continue;
- TAILQ_FOREACH(ia, &state->addrs, next) {
- if (IN6_IS_ADDR_LINKLOCAL(&ia->addr))
+ state = IPV6_STATE(ifp);
+ if (state == NULL)
continue;
- /* Let's be optimistic.
- * Any decent OS won't forward or accept traffic
- * from/to tentative or detached addresses. */
- if (!(ia->addr_flags & IN6_IFF_DUPLICATED))
- break;
+
+ TAILQ_FOREACH(ia, &state->addrs, next) {
+ if (IN6_IS_ADDR_LINKLOCAL(&ia->addr))
+ continue;
+ /* Let's be optimistic.
+ * Any decent OS won't forward or accept traffic
+ * from/to tentative or detached addresses. */
+ if (!(ia->addr_flags & IN6_IFF_DUPLICATED))
+ return ia;
+ }
}
- return ia;
+ return NULL;
}
void
return;
if ((state = ipv6_getstate(ifp)) == NULL)
return;
- anyglobal = ipv6_ifanyglobal(ifp) != NULL;
+ anyglobal = ipv6_anyglobal(ifp) != NULL;
TAILQ_FOREACH(ia, &state->addrs, next) {
if (IN6_ARE_ADDR_EQUAL(&ia->addr, addr))
* call rt_build to add/remove the default route. */
if (ifp->active && ifp->options->options & DHCPCD_IPV6 &&
!(ctx->options & DHCPCD_RTBUILD) &&
- (ipv6_ifanyglobal(ifp) != NULL) != anyglobal)
+ (ipv6_anyglobal(ifp) != NULL) != anyglobal)
rt_build(ctx, AF_INET6);
}
}
if (rap->lifetime == 0)
continue;
- if (ipv6_ifanyglobal(rap->iface) == NULL)
+ if (ipv6_anyglobal(rap->iface) == NULL)
continue;
rt = inet6_makerouter(rap);
if (rt == NULL)
struct ipv6_addr *ipv6_iffindaddr(struct interface *,
const struct in6_addr *, int);
int ipv6_hasaddr(const struct interface *);
-struct ipv6_addr *ipv6_ifanyglobal(struct interface *);
+struct ipv6_addr *ipv6_anyglobal(struct interface *);
int ipv6_findaddrmatch(const struct ipv6_addr *, const struct in6_addr *,
unsigned int);
struct ipv6_addr *ipv6_findaddr(struct dhcpcd_ctx *,