summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2018-11-30 03:50:23 +0000
committerRoy Marples <roy@openbsd.marples.name>2018-11-30 03:53:34 +0000
commitffec26d990a742dd0529789fe2b507e85731188e (patch)
treeea7e5b4d7961e9b7363cd53955f5f047cf36ad19 /src/if-bsd.c
parent9717abf627c67c404b73447034799789afcb0d9d (diff)
downloaddhcpcd-ffec26d990a742dd0529789fe2b507e85731188e.tar.xz
BSD: Always set RTA_IFP for routes
Unless we are OpenBSD adding INET6 routes without a gateway. this should work, but doesn't. No biggie as no OS currently supports sharing IPv6 addresses on more than one interface.
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c
index bab674ab..9ac6d599 100644
--- a/src/if-bsd.c
+++ b/src/if-bsd.c
@@ -514,8 +514,10 @@ if_route(unsigned char cmd, const struct rt *rt)
!sa_is_loopback(&rt->rt_gateway))
{
rtm->rtm_index = (unsigned short)rt->rt_ifp->index;
- if (!gateway_unspec)
- rtm->rtm_addrs |= RTA_IFP;
+#ifdef __OpenBSD__
+ if (!gateway_unspec && rt->rt_dest.sa_family==AF_INET6)
+#endif
+ rtm->rtm_addrs |= RTA_IFP;
if (!sa_is_unspecified(&rt->rt_ifa))
rtm->rtm_addrs |= RTA_IFA;
}