From c757933596d28b29d15291cb92520d1100cec3af Mon Sep 17 00:00:00 2001 From: ume Date: Sat, 10 Jan 2004 08:59:21 +0000 Subject: try rtinit() only when the route is not installed. this allows, e.g., duplicated attempts of 'ifconfig lo0 ::1' like for IPv4. Obtained from: KAME MFC after: 1 week --- sys/netinet6/in6.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index e8e8652..d5bd36c 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1527,12 +1527,15 @@ in6_ifinit(ifp, ia, sin6, newhost) /* * Special case: - * If the destination address is specified for a point-to-point + * If a new destination address is specified for a point-to-point * interface, install a route to the destination as an interface * direct route. + * XXX: the logic below rejects assigning multiple addresses on a p2p + * interface that share a same destination. */ plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ - if (plen == 128 && ia->ia_dstaddr.sin6_family == AF_INET6) { + if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 && + ia->ia_dstaddr.sin6_family == AF_INET6) { if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD, RTF_UP | RTF_HOST)) != 0) return (error); -- cgit v1.1