summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2004-01-10 08:59:21 +0000
committerume <ume@FreeBSD.org>2004-01-10 08:59:21 +0000
commitc757933596d28b29d15291cb92520d1100cec3af (patch)
tree10ba7ac76ea056f13299e58b7419b52f8d103d4e
parent3481adf42661106c54c4196cd4bc91c2e240323a (diff)
downloadFreeBSD-src-c757933596d28b29d15291cb92520d1100cec3af.zip
FreeBSD-src-c757933596d28b29d15291cb92520d1100cec3af.tar.gz
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
-rw-r--r--sys/netinet6/in6.c7
1 files 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);
OpenPOWER on IntegriCloud