]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Ensure that IPv4LL address is one :)
authorRoy Marples <roy@marples.name>
Tue, 15 Jul 2008 14:59:00 +0000 (14:59 +0000)
committerRoy Marples <roy@marples.name>
Tue, 15 Jul 2008 14:59:00 +0000 (14:59 +0000)
client.c

index e4a1217645aca66865e80e679756ea3ee8dc05cc..7b76662f1b14d84b0df0b6bcb34652bce6260631 100644 (file)
--- a/client.c
+++ b/client.c
@@ -373,7 +373,8 @@ ipv4ll_get_dhcp(uint32_t old_addr)
                dhcp->yiaddr = htonl(LINKLOCAL_ADDR |
                                     (((uint32_t)abs((int)arc4random())
                                       % 0xFD00) + 0x0100));
-               if (dhcp->yiaddr != old_addr)
+               if (dhcp->yiaddr != old_addr &&
+                   IN_LINKLOCAL(ntohl(dhcp->yiaddr)))
                        break;
        }
        return dhcp;