Centralize DHCP timeout, packet reciept, and user-demanded action handling

into state.[ch].  Remove timeout.c.
This commit is contained in:
Nicholas J. Kain
2011-06-29 23:47:31 -04:00
parent bef54a23fb
commit 76ecfffce2
10 changed files with 358 additions and 365 deletions

View File

@@ -113,7 +113,7 @@ static void takedown_if(struct client_state_t *cs)
log_line("nl: taking down interface");
// Same as packet.c: line 258
ifchange(NULL, IFCHANGE_DECONFIG);
cs->dhcpState = DS_INIT_SELECTING;
cs->dhcpState = DS_SELECTING;
cs->timeout = 0;
cs->requestedIP = 0;
cs->packetNum = 0;
@@ -157,7 +157,7 @@ static void nl_handlemsg(struct nlmsghdr *msg, unsigned int len,
if (cs->dhcpState == DS_BOUND) {
if (arp_gw_check(cs) == -1)
log_warning("arp_gw_check could not make arp socket, assuming lease is still OK");
} else if (cs->dhcpState != DS_INIT_SELECTING)
} else if (cs->dhcpState != DS_SELECTING)
takedown_if(cs);
}
} else {