Note that Solaris does not support routes from the ip address to localhost.
#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
#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;
# 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)