From: Roy Marples Date: Thu, 26 Mar 2015 21:39:02 +0000 (+0000) Subject: Fix detecting host routes. X-Git-Tag: v6.8.1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f853cd8a5052a2ee3d301ad479fe453d25a6a2e;p=thirdparty%2Fdhcpcd.git Fix detecting host routes. --- diff --git a/ipv4.c b/ipv4.c index 7e4e7235..e0b2169f 100644 --- a/ipv4.c +++ b/ipv4.c @@ -332,6 +332,12 @@ ipv4_handlert(struct dhcpcd_ctx *ctx, int cmd, struct rt *rt) if (ctx->ipv4_kroutes == NULL) return 0; + /* DHCP host routes have a gateway of the destination. + * We need to emulate that */ + if (rt->gate.s_addr == INADDR_ANY && + rt->net.s_addr == INADDR_BROADCAST) + rt->gate = rt->dest; + f = ipv4_findrt(ctx, rt, 1); switch (cmd) { case RTM_ADD: