From: Roy Marples Date: Tue, 29 Nov 2016 19:44:32 +0000 (+0000) Subject: Continue operation when failing to send packets. X-Git-Tag: v7.0.0-beta1~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9299f1c652d0826fe8f97cec07966aeb39284188;p=thirdparty%2Fdhcpcd.git Continue operation when failing to send packets. My iwn(4) interface on FreeBSD11 and 12 struggles to associate. A side effect of this is running out of buffer until it does, but we need dhcpcd to continue once association is made and the buffers have emptied. --- diff --git a/dhcp.c b/dhcp.c index 2763cfe4..c78d23ed 100644 --- a/dhcp.c +++ b/dhcp.c @@ -1767,10 +1767,10 @@ send_message(struct interface *ifp, uint8_t type, } else { size_t ulen; - r = 0; udp = dhcp_makeudppacket(&ulen, (uint8_t *)bootp, len, from,to); if (udp == NULL) { logger(ifp->ctx, LOG_ERR, "dhcp_makeudppacket: %m"); + r = 0; } else { r = if_sendraw(ifp, state->raw_fd, ETHERTYPE_IP, (uint8_t *)udp, ulen); @@ -1788,6 +1788,7 @@ send_message(struct interface *ifp, uint8_t type, case ENETDOWN: case ENETRESET: case ENETUNREACH: + case ENOBUFS: break; default: if (!(ifp->ctx->options & DHCPCD_TEST)) diff --git a/dhcp6.c b/dhcp6.c index dfccde07..215fa73f 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -1203,9 +1203,10 @@ logsend: if (sendmsg(ctx->dhcp6_fd, &ctx->sndhdr, 0) == -1) { logger(ifp->ctx, LOG_ERR, "%s: %s: sendmsg: %m", ifp->name, __func__); - ifp->options->options &= ~DHCPCD_IPV6; - dhcp6_drop(ifp, "EXPIRE6"); - return -1; + /* Allow DHCPv6 to continue .... the errors + * would be rate limited by the protocol. + * Generally the error is ENOBUFS when struggling to + * associate with an access point. */ } state->RTC++; diff --git a/ipv6nd.c b/ipv6nd.c index aed0bcd0..06f79744 100644 --- a/ipv6nd.c +++ b/ipv6nd.c @@ -307,9 +307,10 @@ ipv6nd_sendrsprobe(void *arg) if (sendmsg(ctx->nd_fd, &ctx->sndhdr, 0) == -1) { logger(ifp->ctx, LOG_ERR, "%s: %s: sendmsg: %m", ifp->name, __func__); - ipv6nd_drop(ifp); - ifp->options->options &= ~(DHCPCD_IPV6 | DHCPCD_IPV6RS); - return; + /* Allow IPv6ND to continue .... at most a few errors + * would be logged. + * Generally the error is ENOBUFS when struggling to + * associate with an access point. */ } if (state->rsprobes++ < MAX_RTR_SOLICITATIONS)