Clean up raw socket read error path a bit.
This commit is contained in:
parent
7026a9c120
commit
37bf851ca7
@ -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;
|
||||
}
|
||||
|
@ -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 */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user