diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-09-04 13:00:42 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-09-04 13:00:42 +0000 |
commit | 2f374aef2212fa2db0505db021599697c89d3dd3 (patch) | |
tree | 18a41008eb4782cfa0c26a91a36cf6844c70dc6e /sys | |
parent | a3ba7bf60539cba35324a85e238afb4f0450707d (diff) |
Tunnels also need a cloning route.
Fix a regression reported by Brad.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/in6.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 63f45a18882..4444dbc35b6 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.169 2015/08/31 08:33:01 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.170 2015/09/04 13:00:41 mpi Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -462,7 +462,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) case SIOCAIFADDR_IN6: { - int error = 0; + int plen, error = 0; /* reject read-only flags */ if ((ifra->ifra_flags & IN6_IFF_DUPLICATED) != 0 || @@ -508,7 +508,8 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) if (ia6->ia6_flags & IN6_IFF_TENTATIVE) nd6_dad_start(&ia6->ia_ifa); - if (ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) { + plen = in6_mask2len(&ia6->ia_prefixmask.sin6_addr, NULL); + if ((ifp->if_flags & IFF_LOOPBACK) || plen == 128) { dohooks(ifp->if_addrhooks, 0); break; /* No need to install a connected route. */ } @@ -956,6 +957,7 @@ void in6_unlink_ifa(struct in6_ifaddr *ia6, struct ifnet *ifp) { struct ifaddr *ifa = &ia6->ia_ifa; + int plen; splsoftassert(IPL_SOFTNET); @@ -965,7 +967,8 @@ in6_unlink_ifa(struct in6_ifaddr *ia6, struct ifnet *ifp) /* Release the reference to the base prefix. */ if (ia6->ia6_ndpr == NULL) { - if ((ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) == 0) { + plen = in6_mask2len(&ia6->ia_prefixmask.sin6_addr, NULL); + if ((ifp->if_flags & IFF_LOOPBACK) == 0 && plen != 128) { rt_ifa_del(ifa, RTF_CLONING | RTF_CONNECTED, ifa->ifa_addr); } |