Remove RA's before the DHCP lease.
Correctly send 3 RA solicitations.
if_up=false
if_down=false
case "$reason" in
-BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC|ROUTERADVERT) if_up=true;;
-PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) if_down=true;;
+BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) if_up=true;;
+PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) if_down=true;;
esac
+[ "$reason" = ROUTERADVERT -a "$ra_count" != 0 ] && if_up=true
+
# Ensure that all arguments are unique
uniqify()
{
struct interface *ifp, *ifl = NULL;
syslog(LOG_INFO, "%s: removing interface", iface->name);
- if (strcmp(iface->state->reason, "RELEASE") != 0)
- drop_dhcp(iface, "STOP");
if (iface->ras) {
ipv6rs_free(iface);
iface->ras = NULL;
iface->state->reason = "ROUTERADVERT";
run_script(iface);
}
+ if (strcmp(iface->state->reason, "RELEASE") != 0)
+ drop_dhcp(iface, "STOP");
close_sockets(iface);
delete_timeout(NULL, iface);
for (ifp = ifaces; ifp; ifp = ifp->next) {
if (sendmsg(sock, &sndhdr, 0) == -1)
syslog(LOG_ERR, "%s: sendmsg: %m", ifp->name);
- if (++ifp->rsprobes < MAX_RTR_SOLICITATIONS)
+ if (ifp->rsprobes++ < MAX_RTR_SOLICITATIONS)
add_timeout_sec(RTR_SOLICITATION_INTERVAL,
ipv6rs_sendprobe, ifp);
else
if (options & DHCPCD_TEST)
exit(EXIT_SUCCESS);
+ delete_q_timeout(0, handle_exit_timeout, NULL);
delete_timeouts(ifp, NULL);
ipv6rs_expire(ifp);
daemonise();