mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-24 10:35:03 +08:00
Drop DHCPv6 on carrier down.
Send DHCPv6 interface information.
This commit is contained in:
parent
5ba29cbd2b
commit
652b80c8a9
@ -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;
|
||||
}
|
||||
|
||||
|
1
dhcp6.h
1
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)))
|
||||
|
5
dhcpcd.c
5
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++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user