]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't request the last tried IPV4LL address.
authorRoy Marples <roy@marples.name>
Fri, 30 May 2008 09:51:45 +0000 (09:51 +0000)
committerRoy Marples <roy@marples.name>
Fri, 30 May 2008 09:51:45 +0000 (09:51 +0000)
client.c

index db9e7e035b0caf217d3057ba90e034c71f322c60..d2cf24c5a451bd6fa1eb4504947fa96b46f96c60 100644 (file)
--- a/client.c
+++ b/client.c
@@ -327,12 +327,17 @@ ipv4ll_lease(struct dhcp_lease *lease)
 static int
 ipv4ll_get_address(struct interface *iface, struct dhcp_lease *lease) {
        struct in_addr addr;
+       struct in_addr old;
        int conflicts = 0;
 
+       old.s_addr = 0;
        for (;;) {
                addr.s_addr = htonl(LINKLOCAL_ADDR |
                                    (((uint32_t)abs((int)arc4random())
                                      % 0xFD00) + 0x0100));
+               if (addr.s_addr == old.s_addr)
+                       continue;
+               old.s_addr = addr.s_addr;
                if (!arp_claim(iface, addr))
                        break;
                if (errno != EEXIST)