diff options
| author | Roy Marples <roy@marples.name> | 2013-05-17 23:09:36 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2013-05-17 23:09:36 +0000 |
| commit | 5331b839c9a0feac60ae563b051609eba9a066ab (patch) | |
| tree | 584fe9f5aafc9250c154618e987c49db0579374e /dhcpcd.c | |
| parent | 21701103539f281964a5ccd2ba9ff75b497dae04 (diff) | |
| download | dhcpcd-5331b839c9a0feac60ae563b051609eba9a066ab.tar.xz | |
Store IPv6 link local addresses per interface.
Listen to kernel messages to account them.
If we don't have a local link address, delay IPv6RS as it just
won#t work until we have a local link address.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -369,8 +369,7 @@ handle_carrier(int action, int flags, const char *ifname) return; ifp = find_interface(ifname); if (ifp == NULL) { - if (options & DHCPCD_LINK) - handle_interface(1, ifname); + handle_interface(1, ifname); return; } if (!(ifp->options->options & DHCPCD_LINK)) @@ -457,18 +456,6 @@ init_state(struct interface *ifp, int argc, char **argv) configure_interface(ifp, argc, argv); ifo = ifp->options; - /* RTM_NEWADDR goes through the link socket as well which we - * need for IPv6 DAD, so we check for DHCPCD_LINK in handle_carrier - * instead */ - if (linkfd == -1) { - linkfd = open_link_socket(); - if (linkfd == -1) { - syslog(LOG_ERR, "open_link_socket: %m"); - ifo->options &= ~DHCPCD_LINK; - } else - eloop_event_add(linkfd, handle_link, NULL); - } - if (ifo->options & DHCPCD_IPV4 && ipv4_init() == -1) { syslog(LOG_ERR, "ipv4_init: %m"); ifo->options &= ~DHCPCD_IPV4; @@ -1142,6 +1129,19 @@ main(int argc, char **argv) if (ifc == 1) options |= DHCPCD_WAITIP; + /* RTM_NEWADDR goes through the link socket as well which we + * need for IPv6 DAD, so we check for DHCPCD_LINK in handle_carrier + * instead. + * We also need to open this before checking for interfaces below + * so that we pickup any new addresses during the discover phase. */ + if (linkfd == -1) { + linkfd = open_link_socket(); + if (linkfd == -1) + syslog(LOG_ERR, "open_link_socket: %m"); + else + eloop_event_add(linkfd, handle_link, NULL); + } + ifaces = discover_interfaces(ifc, ifv); for (i = 0; i < ifc; i++) { if (find_interface(ifv[i]) == NULL) |
