From: Roy Marples Date: Tue, 6 Sep 2016 10:43:49 +0000 (+0000) Subject: Remove the POLLADDR check out of if-bsd.c and into ipv6.c for other OS's X-Git-Tag: v6.11.4~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=375aae4fbb63cdea339b93e83e2ad5d3b2f72c64;p=thirdparty%2Fdhcpcd.git Remove the POLLADDR check out of if-bsd.c and into ipv6.c for other OS's --- diff --git a/if-bsd.c b/if-bsd.c index 8bc4b496..7322bae0 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -1289,11 +1289,6 @@ if_ifinfo(struct dhcpcd_ctx *ctx, const struct if_msghdr *ifm) { struct interface *ifp; int link_state; -#ifdef IPV6_POLLADDRFLAG - struct ipv6_state *state; - struct ipv6_addr *ia; - int flags; -#endif if ((ifp = if_findindex(ctx->ifaces, ifm->ifm_index)) == NULL) return; @@ -1304,16 +1299,6 @@ if_ifinfo(struct dhcpcd_ctx *ctx, const struct if_msghdr *ifm) case LINK_STATE_UP: /* dhcpcd considers the link down if IFF_UP is not set. */ link_state = ifm->ifm_flags & IFF_UP ? LINK_UP : LINK_DOWN; - -#ifdef IPV6_POLLADDRFLAG - /* We need to update the address flags incase they were - * marked tentative on down. */ - state = IPV6_STATE(ifp); - TAILQ_FOREACH(ia, &state->addrs, next) { - if ((flags = if_addrflags6(ia)) != -1) - ia->addr_flags = flags; - } -#endif break; default: /* handle_carrier will re-load the interface flags and check for diff --git a/ipv6.c b/ipv6.c index 9a391774..4b1d9225 100644 --- a/ipv6.c +++ b/ipv6.c @@ -1611,6 +1611,20 @@ ipv6_startstatic(struct interface *ifp) int ipv6_start(struct interface *ifp) { +#ifdef IPV6_POLLADDRFLAG + struct ipv6_state *state; + + /* We need to update the address flags. */ + if ((state = IPV6_STATE(ifp)) != NULL) { + struct ipv6_addr *ia; + int flags; + + TAILQ_FOREACH(ia, &state->addrs, next) { + if ((flags = if_addrflags6(ia)) != -1) + ia->addr_flags = flags; + } + } +#endif if (ipv6_tryaddlinklocal(ifp) == -1) return -1;