Drop DHCPv6 on carrier down.

Send DHCPv6 interface information.
This commit is contained in:
Roy Marples 2012-10-12 19:10:04 +00:00
parent 5ba29cbd2b
commit 652b80c8a9
3 changed files with 10 additions and 0 deletions

View File

@ -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;
}

View File

@ -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)))

View File

@ -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++;
}