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 (r == -1) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
log_line("get_raw_packet: read error %s", strerror(errno));
|
||||||
log_line("EAGAIN or EWOULDBLOCK hit");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
log_line("couldn't read on raw listening socket -- ignoring");
|
|
||||||
usleep(500000); /* possible down interface, looping condition */
|
usleep(500000); /* possible down interface, looping condition */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -314,8 +314,7 @@ static void handle_packet(void)
|
|||||||
len = get_raw_packet(&packet, fd);
|
len = get_raw_packet(&packet, fd);
|
||||||
|
|
||||||
if (len == -1 && errno != EINTR) {
|
if (len == -1 && errno != EINTR) {
|
||||||
log_error("error on read, %s, reopening socket.",
|
log_error("reopening socket.");
|
||||||
strerror(errno));
|
|
||||||
change_mode(listen_mode); /* just close and reopen */
|
change_mode(listen_mode); /* just close and reopen */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user