From: Roy Marples Date: Fri, 17 Oct 2014 13:47:05 +0000 (+0000) Subject: Start DHCPv6 when we already have a delegated state. X-Git-Tag: v6.5.1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e745d5c7b49db9ccff619b9649f601edaa79b10;p=thirdparty%2Fdhcpcd.git Start DHCPv6 when we already have a delegated state. Allow transition from INFORM to DHCPv6 stateful. --- diff --git a/dhcp6.c b/dhcp6.c index 744137dc..72d765e7 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -3147,18 +3147,23 @@ dhcp6_start(struct interface *ifp, enum DH6S init_state) state = D6_STATE(ifp); if (state) { - if (state->state == DH6S_DELEGATED) { - dhcp6_find_delegates(ifp); - return 0; - } if (state->state == DH6S_INFORMED && init_state == DH6S_INFORM) { dhcp6_startinform(ifp); return 0; } + if (init_state == DH6S_INIT && + ifp->options->options & DHCPCD_DHCP6 && + (state->state == DH6S_INFORM || + state->state == DH6S_INFORMED || + state->state == DH6S_DELEGATED)) + { + /* Change from stateless to stateful */ + goto gogogo; + } /* We're already running DHCP6 */ - /* XXX: What if the managed flag changes? */ + /* XXX: What if the managed flag vanishes from all RA? */ return 0; } @@ -3175,16 +3180,13 @@ dhcp6_start(struct interface *ifp, enum DH6S init_state) state->sol_max_rt = SOL_MAX_RT; state->inf_max_rt = INF_MAX_RT; - TAILQ_INIT(&state->addrs); - if (dhcp6_find_delegates(ifp)) - return 0; +gogogo: state->state = init_state; snprintf(state->leasefile, sizeof(state->leasefile), LEASEFILE6, ifp->name, ifp->options->options & DHCPCD_PFXDLGONLY ? ".pd" : ""); - if (ipv6_linklocal(ifp) == NULL) { syslog(LOG_DEBUG, "%s: delaying DHCPv6 soliciation for LL address",