summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mauderer <Christian.Mauderer@embedded-brains.de>2017-11-07 11:54:39 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-10 13:33:03 +0100
commitddd16bcc321e44b9ca2f24a66d6be42fa75860dc (patch)
tree11b7a9a35fb412300d0fc7932ba0cf55a6d134ba
parentlibbsd.txt: Describe current state of WLAN. (diff)
downloadrtems-libbsd-ddd16bcc321e44b9ca2f24a66d6be42fa75860dc.tar.bz2
dhcpcd: Don't ignore interface on transient errors.
In case of WPA on a WiFi interface, the interface isn't yet ready when the dhcpcd starts. Sending a packet during that time returns with a ENOBUFS. That caused the interface to be ignored. On the upstream repository of dhcpcd, that transient error (and some others) are already ignored.
-rw-r--r--dhcpcd/dhcp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/dhcpcd/dhcp.c b/dhcpcd/dhcp.c
index 1641f44c..5a061726 100644
--- a/dhcpcd/dhcp.c
+++ b/dhcpcd/dhcp.c
@@ -1487,6 +1487,9 @@ send_message(struct interface *iface, int type,
struct in_addr from, to;
in_addr_t a = 0;
struct timeval tv;
+#ifdef __rtems__
+ int errno_save;
+#endif /* __rtems__ */
if (!callback)
syslog(LOG_DEBUG, "%s: sending %s with xid 0x%x",
@@ -1544,6 +1547,9 @@ send_message(struct interface *iface, int type,
if (len == -1)
return;
r = ipv4_sendrawpacket(iface, ETHERTYPE_IP, udp, len);
+#ifdef __rtems__
+ errno_save = errno;
+#endif /* __rtems__ */
free(udp);
/* If we failed to send a raw packet this normally means
* we don't have the ability to work beneath the IP layer
@@ -1553,11 +1559,20 @@ send_message(struct interface *iface, int type,
if (r == -1) {
syslog(LOG_ERR, "%s: ipv4_sendrawpacket: %m",
iface->name);
+#ifdef __rtems__
+ if (errno_save != ENETDOWN &&
+ errno_save != ENETRESET &&
+ errno_save != ENETUNREACH &&
+ errno_save != ENOBUFS) {
+#endif /* __rtems__ */
if (!(options & DHCPCD_TEST))
dhcp_drop(iface, "FAIL");
dhcp_close(iface);
eloop_timeout_delete(NULL, iface);
callback = NULL;
+#ifdef __rtems__
+ }
+#endif /* __rtems__ */
}
}
free(dhcp);