From: Roy Marples Date: Mon, 19 Apr 2010 11:16:43 +0000 (+0000) Subject: Force gatetway to zero instead of adding a host route when the interface X-Git-Tag: v5.2.3~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf31ea0173ae6769ef3addf60ff71c4096a48e9;p=thirdparty%2Fdhcpcd.git Force gatetway to zero instead of adding a host route when the interface does not support ARP. This improves performance slighty. Addresses #188. --- diff --git a/configure.c b/configure.c index 6ab86bd8..2d320d58 100644 --- a/configure.c +++ b/configure.c @@ -597,8 +597,15 @@ add_router_host_route(struct rt *rt, const struct interface *ifp) } if (rtn != rtp) continue; + if (ifp->flags & IFF_NOARP) { + syslog(LOG_WARNING, + "%s: forcing router %s through interface", + ifp->name, inet_ntoa(rtp->gate)); + rtp->gate.s_addr = 0; + continue; + } syslog(LOG_WARNING, "%s: router %s requires a host route", - ifp->name, inet_ntoa(rtp->gate)); + ifp->name, inet_ntoa(rtp->gate)); rtn = xmalloc(sizeof(*rtn)); rtn->dest.s_addr = rtp->gate.s_addr; rtn->net.s_addr = INADDR_BROADCAST;