From: Roy Marples Date: Sun, 14 Apr 2019 10:48:29 +0000 (+0300) Subject: sun: Use lo0 if we can't find an interface for our route X-Git-Tag: v7.2.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2a4fc7c9e048d14555a809dafaf8b1fc4951fec;p=thirdparty%2Fdhcpcd.git sun: Use lo0 if we can't find an interface for our route We need to operate on the route, and dhcpcd needs an interface for each route. This seems to work for now. --- diff --git a/src/if-sun.c b/src/if-sun.c index 942b2832..d6534755 100644 --- a/src/if-sun.c +++ b/src/if-sun.c @@ -1012,7 +1012,6 @@ if_plumbif(const struct dhcpcd_ctx *ctx, int af, const char *ifname) } done: - logerrx("plumb %d %d %d", mux_fd, fd, arp_fd); retval = 0; out: @@ -1263,8 +1262,11 @@ if_walkrt(struct dhcpcd_ctx *ctx, char *data, size_t len) * This sucks, so we need to call RTM_GET to * work out the interface. */ if (if_route_get(ctx, &rt) == NULL) { - logerr(__func__); - continue; + rt.rt_ifp = if_loopback(ctx); + if (rt.rt_ifp == NULL) { + logerr(__func__); + continue; + } } if_finishrt(ctx, &rt); } @@ -1319,8 +1321,11 @@ if_walkrt6(struct dhcpcd_ctx *ctx, char *data, size_t len) * This sucks, so we need to call RTM_GET to * work out the interface. */ if (if_route_get(ctx, &rt) == NULL) { - logerr(__func__); - continue; + rt.rt_ifp = if_loopback(ctx); + if (rt.rt_ifp == NULL) { + logerr(__func__); + continue; + } } if_finishrt(ctx, &rt); }