diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-06-30 08:19:04 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-06-30 08:19:04 +0000 |
commit | 65f07566fcf94c21318be746af31c63b4b0050f0 (patch) | |
tree | d14a168e210e244c8ddb8341e3854116ce5802e9 /sys/netinet6/in6_ifattach.c | |
parent | fb10278ef7abb12c652311d4ef05e872c1f1b5d0 (diff) |
Restore the automagically added /64 route on p2p interfaces in order to
send traffic to link-local addresses without default route.
Fix a regression reported by Michael Lechtermann, ok stsp@, sthen@
Diffstat (limited to 'sys/netinet6/in6_ifattach.c')
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 00bc86f1c7e..048bc62e223 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_ifattach.c,v 1.99 2015/12/02 16:35:53 bluhm Exp $ */ +/* $OpenBSD: in6_ifattach.c,v 1.100 2016/06/30 08:19:03 mpi Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -294,7 +294,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid) { struct in6_aliasreq ifra; struct in6_ifaddr *ia6; - int s, error; + int s, error, flags; /* * configure link-local address. @@ -350,14 +350,17 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid) if (ia6->ia6_flags & IN6_IFF_TENTATIVE) nd6_dad_start(&ia6->ia_ifa); - if (ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) { + if (ifp->if_flags & IFF_LOOPBACK) { dohooks(ifp->if_addrhooks, 0); return (0); /* No need to install a connected route. */ } + flags = RTF_CONNECTED; + if ((ifp->if_flags & IFF_POINTOPOINT) == 0) + flags |= RTF_CLONING; + s = splsoftnet(); - error = rt_ifa_add(&ia6->ia_ifa, RTF_CLONING | RTF_CONNECTED, - ia6->ia_ifa.ifa_addr); + error = rt_ifa_add(&ia6->ia_ifa, flags, ia6->ia_ifa.ifa_addr); if (error) { in6_purgeaddr(&ia6->ia_ifa); splx(s); |