-/* $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 $ */
/*
{
struct in6_aliasreq ifra;
struct in6_ifaddr *ia6;
- int s, error;
+ int s, error, flags;
/*
* configure link-local address.
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);