From: Roy Marples Date: Fri, 30 May 2008 09:51:45 +0000 (+0000) Subject: Don't request the last tried IPV4LL address. X-Git-Tag: v4.0.2~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=317e2b6ef048548942ca70d21f062a0a2faa0da5;p=thirdparty%2Fdhcpcd.git Don't request the last tried IPV4LL address. --- diff --git a/client.c b/client.c index db9e7e03..d2cf24c5 100644 --- 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)