diff options
| author | Roy Marples <roy@marples.name> | 2007-10-11 08:53:29 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2007-10-11 08:53:29 +0000 |
| commit | a31bd7a2adb330fc04ee7fa87f2844f12a95f3bf (patch) | |
| tree | cd10a18bf20fbcb6e01a26d6583fdd79edb542b1 /arp.c | |
| parent | 921aaebd1d280ec43acc8c2ecb09af42f09de46e (diff) | |
| download | dhcpcd-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.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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; } } |
