Only remove the interface from DHCP consideration if the error

sending a packet is not a network error.
This commit is contained in:
Roy Marples 2014-05-20 08:36:12 +00:00
parent 047235d751
commit f31c6094c5

18
dhcp.c
View File

@ -1613,11 +1613,19 @@ send_message(struct interface *iface, uint8_t type,
if (r == -1) {
syslog(LOG_ERR, "%s: if_sendrawpacket: %m",
iface->name);
if (!(iface->ctx->options & DHCPCD_TEST))
dhcp_drop(iface, "FAIL");
dhcp_close(iface);
eloop_timeout_delete(iface->ctx->eloop, NULL, iface);
callback = NULL;
switch(errno) {
case ENETDOWN:
case ENETRESET:
case ENETUNREACH:
break;
default:
if (!(iface->ctx->options & DHCPCD_TEST))
dhcp_drop(iface, "FAIL");
dhcp_close(iface);
eloop_timeout_delete(iface->ctx->eloop,
NULL, iface);
callback = NULL;
}
}
}
free(dhcp);