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 | ad4fd2c042a446703c41bd9065534e383d6e2c0c (patch) | |
| tree | a3d439667a0e844b222df9a93b92a53d856cae24 /src/if-bsd.c | |
| parent | 783c0a66b7d470c4359bf7619df6185f9e923a62 (diff) | |
| download | dhcpcd-ad4fd2c042a446703c41bd9065534e383d6e2c0c.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.
Diffstat (limited to 'src/if-bsd.c')
| -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); |
