From: Roy Marples Date: Tue, 20 May 2014 08:36:12 +0000 (+0000) Subject: Only remove the interface from DHCP consideration if the error X-Git-Tag: v6.4.0~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f31c6094c5770be2fbb45a283faccf40a9e3a650;p=thirdparty%2Fdhcpcd.git Only remove the interface from DHCP consideration if the error sending a packet is not a network error. --- diff --git a/dhcp.c b/dhcp.c index a89d4bf8..2d0fe3cc 100644 --- a/dhcp.c +++ b/dhcp.c @@ -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);