Fix a problem where, when ndhc is waiting for an arp packet, an arp packet
is received that is discarded by ndhc's basic checks and provokes a busy loop in the main program loop because epoll_wait() constantly sees data that is never drained from the socket buffer since arp_offset exceeds the maximum size of an ARP packet and would overflow the packet buffer.
This commit is contained in:
parent
d1f36cf75e
commit
52fbeb46ad
11
ndhc/arp.c
11
ndhc/arp.c
@ -302,14 +302,15 @@ void handle_arp_response(struct client_state_t *cs)
|
||||
arpreply_offset += r;
|
||||
}
|
||||
|
||||
if (arpreply_offset < ARP_MSG_SIZE) {
|
||||
log_warning("arp: Received short ARP message -- ignoring");
|
||||
|
||||
if (arpreply_offset < ARP_MSG_SIZE)
|
||||
return;
|
||||
|
||||
if (!arp_validate(&arpreply)) {
|
||||
arpreply_clear();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!arp_validate(&arpreply))
|
||||
return;
|
||||
|
||||
++arp_packet_num;
|
||||
switch (cs->dhcpState) {
|
||||
case DS_ARP_CHECK:
|
||||
|
Loading…
Reference in New Issue
Block a user