# 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
/* 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) {
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) {
/* 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) {