From: Roy Marples Date: Sat, 26 Aug 2017 14:06:39 +0000 (+0100) Subject: Ensure that IN6_IFF_TEMPORARY is defined before checking it on Linux. X-Git-Tag: v7.0.0-rc2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56ef6d331a1f2bfdf2a0a28a6108e1dfc9aff2d4;p=thirdparty%2Fdhcpcd.git Ensure that IN6_IFF_TEMPORARY is defined before checking it on Linux. --- diff --git a/src/ipv6.h b/src/ipv6.h index 4866aede..9f0ccdae 100644 --- a/src/ipv6.h +++ b/src/ipv6.h @@ -94,35 +94,11 @@ # undef IPV6_POLLADDRFLAG #endif -/* - * If dhcpcd handles RA processing instead of the kernel, the kernel needs - * to either allow userland to set temporary addresses or mark an address - * for the kernel to manage temporary addresses from. - * If the kernel allows the former, a global #define is needed, otherwise - * the address marking will be handled in the platform specific address handler. - * - * Some BSDs do not allow userland to set temporary addresses. - * Linux-3.18 allows the marking of addresses from which to manage temp addrs. - */ -#if defined(BSD) && defined(IN6_IFF_TEMPORARY) -#define IPV6_MANAGETEMPADDR -#endif - -/* - * You could enable IPV6_MANAGETEMPADDR anyway and disable the platform - * specific address marking to test dhcpcd's temporary address handling as well, - * but this will not affect source address selection so is of very limited use. - */ -#if 0 -/* Pretend we have an old Linux kernel. */ -#undef IFA_F_MANAGETEMPADDR -/* Enable dhcpcd handling temporary addresses. */ -#define IPV6_MANAGETEMPADDR -#endif - #ifdef __linux__ /* Match Linux defines to BSD */ -# define IN6_IFF_TEMPORARY IFA_F_TEMPORARY +# ifdef IFA_F_TEMPORARY +# define IN6_IFF_TEMPORARY IFA_F_TEMPORARY +# endif # ifdef IFA_F_OPTIMISTIC # define IN6_IFF_TENTATIVE (IFA_F_TENTATIVE | IFA_F_OPTIMISTIC) # else @@ -149,6 +125,20 @@ #define IN6_IFF_NOTUSEABLE \ (IN6_IFF_TENTATIVE | IN6_IFF_DUPLICATED | IN6_IFF_DETACHED) +/* + * If dhcpcd handles RA processing instead of the kernel, the kernel needs + * to either allow userland to set temporary addresses or mark an address + * for the kernel to manage temporary addresses from. + * If the kernel allows the former, a global #define is needed, otherwise + * the address marking will be handled in the platform specific address handler. + * + * Some BSDs do not allow userland to set temporary addresses. + * Linux-3.18 allows the marking of addresses from which to manage temp addrs. + */ +#ifdef IN6_IFF_TEMPORARY +#define IPV6_MANAGETEMPADDR +#endif + TAILQ_HEAD(ipv6_addrhead, ipv6_addr); struct ipv6_addr { TAILQ_ENTRY(ipv6_addr) next;