From: Roy Marples Date: Mon, 16 Apr 2018 08:37:04 +0000 (+0100) Subject: BSD: move the interface hint up the stack X-Git-Tag: v7.0.4~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8827e45fedbddc7e7060c47a92e9d9820b5e83c0;p=thirdparty%2Fdhcpcd.git BSD: move the interface hint up the stack This probably isn't needed, but allows us to hint the interface when not directly setting IFP. --- diff --git a/src/if-bsd.c b/src/if-bsd.c index 7cd61903..c3c95ba6 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -499,6 +499,7 @@ if_route(unsigned char cmd, const struct rt *rt) if (!(rtm->rtm_flags & RTF_REJECT) && !sa_is_loopback(&rt->rt_gateway)) { + rtm->rtm_index = (unsigned short)rt->rt_ifp->index; if (!gateway_unspec) rtm->rtm_addrs |= RTA_IFP; if (!sa_is_unspecified(&rt->rt_ifa)) @@ -572,10 +573,8 @@ if_route(unsigned char cmd, const struct rt *rt) if (rtm->rtm_addrs & RTA_NETMASK) ADDSA(&rt->rt_netmask); - if (rtm->rtm_addrs & RTA_IFP) { - rtm->rtm_index = (unsigned short)rt->rt_ifp->index; + if (rtm->rtm_addrs & RTA_IFP) ADDSA((struct sockaddr *)&sdl); - } if (rtm->rtm_addrs & RTA_IFA) ADDSA(&rt->rt_ifa);