From: Roy Marples Date: Thu, 15 May 2008 12:15:49 +0000 (+0000) Subject: Loop correctly for more packets. X-Git-Tag: v4.0.2~399 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2eebbca565e80370d617f7c325510f7c29811693;p=thirdparty%2Fdhcpcd.git Loop correctly for more packets. --- diff --git a/net.c b/net.c index 6f7a7dec..388f2674 100644 --- a/net.c +++ b/net.c @@ -745,8 +745,8 @@ arp_claim(struct interface *iface, struct in_addr address) if (!(fds[1].revents & POLLIN)) continue; - for (;;) { - memset(arp_reply, 0, sizeof(arp_reply)); + do { + memset(&arp_reply, 0, sizeof(arp_reply)); bytes = get_packet(iface, &arp_reply, sizeof(arp_reply)); if (bytes <= 0) break; @@ -783,7 +783,7 @@ arp_claim(struct interface *iface, struct in_addr address) hwaddr_ntoa((unsigned char *)&reply_mac, (size_t)reply.ar_hln)); retval = -1; goto eexit; - } + } while (iface->buffer_pos != 0); } eexit: