Make arp code more robust and refactor it a bit.

Handle failure to create arp sockets more gracefully.
Add initial support for retransmitting arp requests if no reply is met after
a certain number of spurious packets.
This commit is contained in:
Nicholas J. Kain
2011-03-31 02:32:34 -04:00
parent f4aa2058db
commit a7db2c4bd2
7 changed files with 115 additions and 78 deletions

View File

@ -155,7 +155,8 @@ static void nl_handlemsg(struct nlmsghdr *msg, unsigned int len,
* If we don't have a lease, state -> INIT.
*/
if (cs->dhcpState == DS_BOUND) {
arp_gw_check(cs);
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)
takedown_if(cs);
}