summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-09-02 12:07:03 +0100
committerRoy Marples <roy@marples.name>2019-09-02 12:07:03 +0100
commitc6a5e6c5e34a3264680cd79ff55dba6bd6df3959 (patch)
tree3edbc7df5fe62b3426bfc43e715afbbc911f08b5 /src/if-bsd.c
parentfbb9b7c3b7714f02f857cdb5b9743ad0e1f10ee1 (diff)
downloaddhcpcd-c6a5e6c5e34a3264680cd79ff55dba6bd6df3959.tar.xz
BSD: RTM_MISS doesn't always have a gateway
And thus no interface to bind to. Use lo0 in this case.
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c3
1 files changed, 3 insertions, 0 deletions
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;