diff options
| author | Roy Marples <roy@marples.name> | 2018-04-16 09:37:04 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2018-04-16 09:37:04 +0100 |
| commit | 8827e45fedbddc7e7060c47a92e9d9820b5e83c0 (patch) | |
| tree | a3d439667a0e844b222df9a93b92a53d856cae24 | |
| parent | f8fe2d50e3e1c722fe20273718bc8feb809719dd (diff) | |
| download | dhcpcd-8827e45fedbddc7e7060c47a92e9d9820b5e83c0.tar.xz | |
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.
| -rw-r--r-- | src/if-bsd.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); |
