static void
handle_arp_failure(struct interface *iface)
{
- if (iface->state->offer->cookie != htonl(MAGIC_COOKIE)) {
+
+ /* If we failed without a magic cookie then we need to try
+ * and defend our IPv4LL address. */
+ if ((iface->state->offer != NULL &&
+ iface->state->offer->cookie != htonl(MAGIC_COOKIE)) ||
+ (iface->state->new != NULL &&
+ iface->state->new->cookie != htonl(MAGIC_COOKIE)))
+ {
handle_ipv4ll_failure(iface);
return;
}
+
unlink(iface->leasefile);
if (!iface->state->lease.frominfo)
send_decline(iface);
struct interface *iface = arg;
time_t up;
- if (iface->state->fail.s_addr == iface->state->lease.addr.s_addr) {
+ if (iface->state->fail.s_addr == iface->addr.s_addr) {
up = uptime();
if (iface->state->defend + DEFEND_INTERVAL > up) {
+ syslog(LOG_DEBUG,
+ "%s: IPv4LL %d second defence failed",
+ iface->name, DEFEND_INTERVAL);
drop_config(iface, "EXPIRE");
iface->state->conflicts = -1;
} else {
+ syslog(LOG_DEBUG, "%s: defended IPv4LL address",
+ iface->name);
iface->state->defend = up;
return;
}