]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Remove the POLLADDR check out of if-bsd.c and into ipv6.c for other OS's
authorRoy Marples <roy@marples.name>
Tue, 6 Sep 2016 10:43:49 +0000 (10:43 +0000)
committerRoy Marples <roy@marples.name>
Tue, 6 Sep 2016 10:43:49 +0000 (10:43 +0000)
if-bsd.c
ipv6.c

index 8bc4b496d9bfae9759c5dc38f47a551b67b83dc4..7322bae09f09af64eea1f4084139b3ee3281dbd3 100644 (file)
--- 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 9a391774af87fb7191374f7e0360ad8f633ea481..4b1d92258316ad387648de8636529b08fb187384 100644 (file)
--- 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;