summaryrefslogtreecommitdiffstats
path: root/arp.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-11 08:53:29 +0000
committerRoy Marples <roy@marples.name>2007-10-11 08:53:29 +0000
commita31bd7a2adb330fc04ee7fa87f2844f12a95f3bf (patch)
treecd10a18bf20fbcb6e01a26d6583fdd79edb542b1 /arp.c
parent921aaebd1d280ec43acc8c2ecb09af42f09de46e (diff)
downloaddhcpcd-a31bd7a2adb330fc04ee7fa87f2844f12a95f3bf.tar.xz
Skip over bogus EINTR error on select when arp checking for a different address from what we already have. This should not happen, so a better fix is probably needed.
Diffstat (limited to 'arp.c')
-rw-r--r--arp.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/arp.c b/arp.c
index 405895ef..e2be80ca 100644
--- a/arp.c
+++ b/arp.c
@@ -141,10 +141,19 @@ int arp_claim (interface_t *iface, struct in_addr address)
FD_ZERO (&rset);
FD_SET (iface->fd, &rset);
- errno = 0;
- if ((s = select (FD_SETSIZE, &rset, NULL, NULL, &tv)) == -1) {
- if (errno != EINTR)
- logger (LOG_ERR, "select: `%s'", strerror (errno));
+ if ((s = select (iface->fd + 1, &rset, NULL, NULL, &tv)) == -1) {
+ /* If anyone can explain why we get an EINTR when probing
+ * for an ip address we don't have assigned, I'd like to here
+ * from you - hopefully with a patch or info on how to fix.
+ * Note, no signal is really received, so it's probably a
+ * bogus error as we've done something wrong somewhere.
+ * Until then, we ignore it and continue. Or timeout an flood
+ * protection should be robust enough to cater for this.
+ * This happens on both Linux and FreeBSD. */
+ if (errno == EINTR)
+ continue;
+
+ logger (LOG_ERR, "select: `%s'", strerror (errno));
break;
}
}