]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
BSD: Always set RTA_IFP for routes
authorRoy Marples <roy@marples.name>
Fri, 30 Nov 2018 03:50:23 +0000 (03:50 +0000)
committerRoy Marples <roy@openbsd.marples.name>
Fri, 30 Nov 2018 03:53:34 +0000 (03:53 +0000)
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.

src/if-bsd.c

index bab674ab15aaf6a3ebc32a65cf5c8595ff572373..9ac6d59902d60de1ba256be5ed28cbdce12eef28 100644 (file)
@@ -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;
                }