]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Solaris allows a route per gateway as well.
authorRoy Marples <roy@marples.name>
Mon, 12 Sep 2016 16:03:19 +0000 (16:03 +0000)
committerRoy Marples <roy@marples.name>
Mon, 12 Sep 2016 16:03:19 +0000 (16:03 +0000)
if.h
ipv4.c
ipv6.c

diff --git a/if.h b/if.h
index b38b43ac26257b93d704019ca4dda9d8642d23c2..670c8b8a98c5fbc799e5ae8bfdee5f11d06f783d 100644 (file)
--- a/if.h
+++ b/if.h
 # endif
 #endif
 
+#if defined(__OpenBSD) || defined (__sun)
+#  define ROUTE_PER_GATEWAY
+/* XXX dhcpcd doesn't really support this yet.
+ * But that's generally OK if only dhcpcd is managing routes. */
+#endif
+
 /* Some systems have in-built IPv4 DAD.
  * However, we need them to do DAD at carrier up as well. */
 #ifdef IN_IFF_TENTATIVE
diff --git a/ipv4.c b/ipv4.c
index 98fb2b04ac84861d1f0916a9b9e58906d4c79b5d..cc80b532cf16e0ba617ca3c6cb71dce945d1af00 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -483,7 +483,7 @@ nc_route(struct rt *ort, struct rt *nrt)
 
        /* No route metrics, we need to delete the old route before
         * adding the new one. */
-#ifdef __OpenBSD__
+#ifdef ROUTE_PER_GATEWAY
        errno = 0;
 #endif
        if (ort) {
@@ -492,8 +492,8 @@ nc_route(struct rt *ort, struct rt *nrt)
                else
                        d_kroute(ort);
        }
-#ifdef __OpenBSD__
-       /* OpenBSD allows many routes to the same dest with different gateways.
+#ifdef ROUTE_PER_GATEWAY
+       /* The OS allows many routes to the same dest with different gateways.
         * dhcpcd does not support this yet, so for the time being just keep on
         * deleting the route until there is an error. */
        if (ort && errno == 0) {
diff --git a/ipv6.c b/ipv6.c
index eb1dfcc6d3dc6dd18ed6d68d89eeac46e108cf1b..61bc3c63284518a1a8941df3edd6b42ed05db21b 100644 (file)
--- a/ipv6.c
+++ b/ipv6.c
@@ -2285,13 +2285,13 @@ nc_route(struct rt6 *ort, struct rt6 *nrt)
 
        /* No route metrics, we need to delete the old route before
         * adding the new one. */
-#ifdef __OpenBSD__
+#ifdef ROUTE_PER_GATEWAY
        errno = 0;
 #endif
        if (ort && if_route6(RTM_DELETE, ort) == -1 && errno != ESRCH)
                logger(nrt->iface->ctx, LOG_ERR, "if_route6 (DEL): %m");
-#ifdef __OpenBSD__
-       /* OpenBSD allows many routes to the same dest with different gateways.
+#ifdef ROUTE_PER_GATEWAY
+       /* The OS allows many routes to the same dest with different gateways.
         * dhcpcd does not support this yet, so for the time being just keep on
         * deleting the route until there is an error. */
        if (ort && errno == 0) {