]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Juggle #define ordering.
authorRoy Marples <roy@marples.name>
Wed, 27 Jul 2016 03:54:22 +0000 (03:54 +0000)
committerRoy Marples <roy@marples.name>
Wed, 27 Jul 2016 03:54:22 +0000 (03:54 +0000)
Note that Solaris does not support routes from the ip address to localhost.

ipv4.c
ipv4.h
ipv6.h

diff --git a/ipv4.c b/ipv4.c
index 7407a685c89dfdbb4b89d2279dc130ebb8c3905b..6e9ce04ea53346214a78475c274c1ea50700dc2f 100644 (file)
--- 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 f10eff33b217b45e88d4cdf1c020f6e422fb1ff7..a8a6efb1d3dbad514f9b11d4c48cddfcb266d0e2 100644 (file)
--- a/ipv4.h
+++ b/ipv4.h
 
 #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
     (((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 94033032db403a53ed580a0c5b9893fb19ad2f08..b433c016dfaeeb6c8e6b3cee74bc4f4fe4f5d603 100644 (file)
--- a/ipv6.h
+++ b/ipv6.h
 #  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
 #  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)