#include "net.h"
#include "script.h"
+#define IPV4_LOOPBACK_ROUTE
+#ifdef __linux__
+/* Linux has had loopback routes in the local table since 2.2 */
+#undef IPV4_LOOPBACK_ROUTE
+#endif
+
static struct rt_head *routes;
int
return rt;
}
+#ifdef IPV4_LOOPBACK_ROUTE
static struct rt_head *
add_loopback_route(struct rt_head *rt, const struct interface *ifp)
{
TAILQ_INSERT_HEAD(rt, r, next);
return rt;
}
+#endif
static struct rt_head *
get_routes(struct interface *ifp)
dnr = get_routes(ifp);
dnr = massage_host_routes(dnr, ifp);
dnr = add_subnet_route(dnr, ifp);
+#ifdef IPV4_LOOPBACK_ROUTE
dnr = add_loopback_route(dnr, ifp);
+#endif
if (ifp->options->options & DHCPCD_GATEWAY) {
dnr = add_router_host_route(dnr, ifp);
dnr = add_destination_route(dnr, ifp);