From: Roy Marples Date: Wed, 27 Jul 2016 03:54:22 +0000 (+0000) Subject: Juggle #define ordering. X-Git-Tag: v6.11.2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c194ed136796dae0cf9e4ab12e84d4d223f57e46;p=thirdparty%2Fdhcpcd.git Juggle #define ordering. Note that Solaris does not support routes from the ip address to localhost. --- diff --git a/ipv4.c b/ipv4.c index 7407a685..6e9ce04e 100644 --- a/ipv4.c +++ b/ipv4.c @@ -53,8 +53,9 @@ #include "script.h" #define IPV4_LOOPBACK_ROUTE -#if defined(__linux__) || (defined(BSD) && defined(RTF_LOCAL)) -/* Linux has had loopback routes in the local table since 2.2 */ +#if defined(__linux__) || defined(__sun) || (defined(BSD) && defined(RTF_LOCAL)) +/* Linux has had loopback routes in the local table since 2.2 + * Solaris does not seem to support loopback routes. */ #undef IPV4_LOOPBACK_ROUTE #endif diff --git a/ipv4.h b/ipv4.h index f10eff33..a8a6efb1 100644 --- a/ipv4.h +++ b/ipv4.h @@ -30,21 +30,6 @@ #include "dhcpcd.h" -#ifdef __sun - /* Solaris lacks these defines. - * While it supports DaD, to seems to only expose IFF_DUPLICATE - * so we have no way of knowing if it's tentative or not. - * I don't even know if Solaris has any special treatment for tentative. */ -# define IN_IFF_TENTATIVE 0 -# define IN_IFF_DUPLICATED 0x02 -# define IN_IFF_DETACHED 0 -#endif - -#ifdef IN_IFF_TENTATIVE -#define IN_IFF_NOTUSEABLE \ - (IN_IFF_TENTATIVE | IN_IFF_DUPLICATED | IN_IFF_DETACHED) -#endif - /* Prefer our macro */ #ifdef HTONL #undef HTONL @@ -72,6 +57,21 @@ (((uint32_t)(A) & 0x000000ff) << 24)) #endif /* BYTE_ORDER */ +#ifdef __sun + /* Solaris lacks these defines. + * While it supports DaD, to seems to only expose IFF_DUPLICATE + * so we have no way of knowing if it's tentative or not. + * I don't even know if Solaris has any special treatment for tentative. */ +# define IN_IFF_TENTATIVE 0 +# define IN_IFF_DUPLICATED 0x02 +# define IN_IFF_DETACHED 0 +#endif + +#ifdef IN_IFF_TENTATIVE +#define IN_IFF_NOTUSEABLE \ + (IN_IFF_TENTATIVE | IN_IFF_DUPLICATED | IN_IFF_DETACHED) +#endif + struct rt { TAILQ_ENTRY(rt) next; struct in_addr dest; diff --git a/ipv6.h b/ipv6.h index 94033032..b433c016 100644 --- a/ipv6.h +++ b/ipv6.h @@ -44,16 +44,6 @@ # endif #endif -#ifdef __sun - /* Solaris lacks these defines. - * While it supports DaD, to seems to only expose IFF_DUPLICATE - * so we have no way of knowing if it's tentative or not. - * I don't even know if Solaris has any special treatment for tentative. */ -# define IN6_IFF_TENTATIVE 0 -# define IN6_IFF_DUPLICATED 0x04 -# define IN6_IFF_DETACHED 0 -#endif - #define ALLROUTERS "ff02::2" #define EUI64_GBIT 0x01 @@ -146,6 +136,16 @@ # define IN6_IFF_DETACHED 0 #endif +#ifdef __sun + /* Solaris lacks these defines. + * While it supports DaD, to seems to only expose IFF_DUPLICATE + * so we have no way of knowing if it's tentative or not. + * I don't even know if Solaris has any special treatment for tentative. */ +# define IN6_IFF_TENTATIVE 0 +# define IN6_IFF_DUPLICATED 0x04 +# define IN6_IFF_DETACHED 0 +#endif + #define IN6_IFF_NOTUSEABLE \ (IN6_IFF_TENTATIVE | IN6_IFF_DUPLICATED | IN6_IFF_DETACHED)