diff options
| author | Roy Marples <roy@marples.name> | 2017-11-14 16:41:59 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2017-11-14 16:41:59 +0000 |
| commit | ae715b1be3d1df1202af6c6f6923a40b07c9ea3c (patch) | |
| tree | 92f16c8ffff3a1517ac960d3dc886d96d55b545c /src/dhcpcd.c | |
| parent | 8d4fec06cd080de8a6b16fe35b8a03c56d1b94e4 (diff) | |
| download | dhcpcd-ae715b1be3d1df1202af6c6f6923a40b07c9ea3c.tar.xz | |
DHCPv6: confirm lease on carrier up
On some platforms which preserve state when carrier goes down,
such as NetBSD-8, the state does not enter the CONFIRM state.
Add more logic to dhcp6_start so that we can better control this
from the various call points.
Diffstat (limited to 'src/dhcpcd.c')
| -rw-r--r-- | src/dhcpcd.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 8b3ac1b5..e677e4c6 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -871,37 +871,22 @@ dhcpcd_startinterface(void *arg) ipv6nd_startrs(ifp); } - if (ifo->options & DHCPCD_DHCP6) + + if (ifo->options & DHCPCD_DHCP6) { dhcp6_find_delegates(ifp); - if ((!(ifo->options & DHCPCD_IPV6RS) || - ifo->options & (DHCPCD_IA_FORCED | DHCPCD_INFORM6)) && - ifp->active == IF_ACTIVE_USER) - { - ssize_t nolease; - - if (ifo->options & DHCPCD_IA_FORCED) - nolease = dhcp6_start(ifp, DH6S_INIT); - else if (ifo->options & DHCPCD_INFORM6) - nolease = dhcp6_start(ifp, DH6S_INFORM); - else { - nolease = 0; - /* Enabling the below doesn't really make - * sense as there is currently no standard - * to push routes via DHCPv6. - * (There is an expired working draft, - * maybe abandoned?) - * You can also get it to work by forcing - * an IA as shown above. */ -#if 0 - /* With no RS or delegates we might - * as well try and solicit a DHCPv6 address */ - if (nolease == 0) - nolease = dhcp6_start(ifp, DH6S_INIT); -#endif + if (ifp->active == IF_ACTIVE_USER) { + enum DH6S d6_state; + + if (ifo->options & DHCPCD_IA_FORCED) + d6_state = DH6S_INIT; + else if (ifo->options & DHCPCD_INFORM6) + d6_state = DH6S_INFORM; + else + d6_state = DH6S_CONFIRM; + if (dhcp6_start(ifp, d6_state) == -1) + logerr("%s: dhcp6_start", ifp->name); } - if (nolease == -1) - logerr("%s: dhcp6_start", ifp->name); } } |
