From: mpi Date: Thu, 30 Jun 2016 08:19:03 +0000 (+0000) Subject: Restore the automagically added /64 route on p2p interfaces in order to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a6f33795cb34a979d8234e421c3c5e784cbe65ab;p=openbsd 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@ --- 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);