From: Roy Marples Date: Mon, 2 Sep 2019 11:07:03 +0000 (+0100) Subject: BSD: RTM_MISS doesn't always have a gateway X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6a5e6c5e34a3264680cd79ff55dba6bd6df3959;p=thirdparty%2Fdhcpcd.git BSD: RTM_MISS doesn't always have a gateway And thus no interface to bind to. Use lo0 in this case. --- diff --git a/src/if-bsd.c b/src/if-bsd.c index 2a7d677d..8348d42d 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -707,6 +707,9 @@ if_copyrt(struct dhcpcd_ctx *ctx, struct rt *rt, const struct rt_msghdr *rtm) else rt->rt_ifp = if_findsa(ctx, rti_info[RTAX_DST]); + if (rt->rt_ifp == NULL && rtm->rtm_type == RTM_MISS) + rt->rt_ifp = if_find(ctx->ifaces, "lo0"); + if (rt->rt_ifp == NULL) { errno = ESRCH; return -1;