From: Roy Marples Date: Wed, 17 Oct 2007 15:46:04 +0000 (+0000) Subject: Always define IN_LINKLOCAL X-Git-Tag: v3.2.3~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b37baaad11ddf85817aaaea5aaac4259b77866f;p=thirdparty%2Fdhcpcd.git Always define IN_LINKLOCAL --- diff --git a/client.c b/client.c index ab75afbf..3ca1abca 100644 --- a/client.c +++ b/client.c @@ -494,9 +494,7 @@ int dhcp_run (const options_t *options, int *pidfd) case STATE_INIT: if (xid != 0) { if (iface->previous_address.s_addr != 0 && -#ifdef ENABLE_IPV4LL ! IN_LINKLOCAL (iface->previous_address.s_addr) && -#endif ! options->doinform) { logger (LOG_ERR, "lost lease"); @@ -605,14 +603,12 @@ int dhcp_run (const options_t *options, int *pidfd) break; case STATE_BOUND: case STATE_RENEW_REQUESTED: -#ifdef ENABLE_IPV4LL if (IN_LINKLOCAL (dhcp->address.s_addr)) { memset (&dhcp->address, 0, sizeof (struct in_addr)); state = STATE_INIT; xid = 0; break; } -#endif state = STATE_RENEWING; xid = random (); case STATE_RENEWING: diff --git a/interface.h b/interface.h index 59f5024f..47dfe539 100644 --- a/interface.h +++ b/interface.h @@ -64,6 +64,15 @@ ((ntohl (addr) & IN_CLASSB_NET) == 0xc0a80000)) #endif +#define LINKLOCAL_ADDR 0xa9fe0000 +#define LINKLOCAL_MASK 0xffff0000 +#define LINKLOCAL_BRDC 0xa9feffff + +#ifndef IN_LINKLOCAL +# define IN_LINKLOCAL(addr) ((ntohl (addr) & IN_CLASSB_NET) == LINKLOCAL_ADDR) +#endif + + typedef struct route_t { struct in_addr destination; diff --git a/ipv4ll.h b/ipv4ll.h index db5cb78b..82ffe0b4 100644 --- a/ipv4ll.h +++ b/ipv4ll.h @@ -25,14 +25,6 @@ #include "dhcp.h" #include "interface.h" -#define LINKLOCAL_ADDR 0xa9fe0000 -#define LINKLOCAL_MASK 0xffff0000 -#define LINKLOCAL_BRDC 0xa9feffff - -#ifndef IN_LINKLOCAL -# define IN_LINKLOCAL(addr) ((ntohl (addr) & IN_CLASSB_NET) == LINKLOCAL_ADDR) -#endif - int ipv4ll_get_address (interface_t *iface, dhcp_t *dhcp); #endif