Clean up raw socket read error path a bit.

This commit is contained in:
Nicholas J. Kain 2010-11-12 21:44:28 -05:00
parent 7026a9c120
commit 37bf851ca7
2 changed files with 2 additions and 7 deletions

View File

@ -189,11 +189,7 @@ int get_raw_packet(struct dhcpMessage *payload, int fd)
if (r == -1) {
if (errno == EINTR)
continue;
if (errno == EAGAIN || errno == EWOULDBLOCK) {
log_line("EAGAIN or EWOULDBLOCK hit");
break;
}
log_line("couldn't read on raw listening socket -- ignoring");
log_line("get_raw_packet: read error %s", strerror(errno));
usleep(500000); /* possible down interface, looping condition */
return -1;
}

View File

@ -314,8 +314,7 @@ static void handle_packet(void)
len = get_raw_packet(&packet, fd);
if (len == -1 && errno != EINTR) {
log_error("error on read, %s, reopening socket.",
strerror(errno));
log_error("reopening socket.");
change_mode(listen_mode); /* just close and reopen */
}