]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Loop correctly for more packets.
authorRoy Marples <roy@marples.name>
Thu, 15 May 2008 12:15:49 +0000 (12:15 +0000)
committerRoy Marples <roy@marples.name>
Thu, 15 May 2008 12:15:49 +0000 (12:15 +0000)
net.c

diff --git a/net.c b/net.c
index 6f7a7dec40fb25c32b4edc2c5594f1c501bee0d9..388f2674c6569a24452bc8a4213a543dbf0d282c 100644 (file)
--- 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: