From c6a5e6c5e34a3264680cd79ff55dba6bd6df3959 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 2 Sep 2019 12:07:03 +0100 Subject: [PATCH] BSD: RTM_MISS doesn't always have a gateway And thus no interface to bind to. Use lo0 in this case. --- src/if-bsd.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.2