From: Roy Marples Date: Fri, 12 Oct 2012 19:10:04 +0000 (+0000) Subject: Drop DHCPv6 on carrier down. X-Git-Tag: v5.99.3~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=652b80c8a9f1573a83e9fb8918b7ec278769ae71;p=thirdparty%2Fdhcpcd.git Drop DHCPv6 on carrier down. Send DHCPv6 interface information. --- diff --git a/configure.c b/configure.c index 90df5e6b..f18e87bb 100644 --- a/configure.c +++ b/configure.c @@ -380,6 +380,10 @@ send_interface(int fd, const struct interface *iface) if (send_interface1(fd, iface, "ROUTERADVERT") == -1) retval = -1; } + if (D6_STATE_RUNNING(iface)) { + if (send_interface1(fd, iface, "INFORM6") == -1) + retval = -1; + } return retval; } diff --git a/dhcp6.h b/dhcp6.h index a42f532b..f6af057c 100644 --- a/dhcp6.h +++ b/dhcp6.h @@ -113,6 +113,7 @@ struct dhcp6_state { }; #define D6_STATE(ifp) ((struct dhcp6_state *)(ifp)->if_data[IF_DATA_DHCP6]) +#define D6_STATE_RUNNING(ifp) (D6_STATE((ifp)) && D6_STATE((ifp))->new) #define D6_FIRST_OPTION(m) \ ((struct dhcp6_option *) \ ((uint8_t *)(m) + sizeof(struct dhcp6_message))) diff --git a/dhcpcd.c b/dhcpcd.c index f98fc8f1..cb473962 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -945,6 +945,7 @@ handle_carrier(int action, int flags, const char *ifname) syslog(LOG_INFO, "%s: carrier lost", iface->name); close_sockets(iface); delete_timeouts(iface, start_expire, NULL); + dhcp6_drop(iface); ipv6rs_drop(iface); drop_dhcp(iface, "NOCARRIER"); } @@ -1639,6 +1640,8 @@ handle_args(struct fd_list *fd, int argc, char **argv) if (argc == 1) { for (ifp = ifaces; ifp; ifp = ifp->next) { len++; + if (D6_STATE_RUNNING(ifp)) + len++; if (ipv6rs_has_ra(ifp)) len++; } @@ -1654,6 +1657,8 @@ handle_args(struct fd_list *fd, int argc, char **argv) for (ifp = ifaces; ifp; ifp = ifp->next) if (strcmp(argv[opt], ifp->name) == 0) { len++; + if (D6_STATE_RUNNING(ifp)) + len++; if (ipv6rs_has_ra(ifp)) len++; }