summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2016-01-09 11:41:37 +0000
committermelifaro <melifaro@FreeBSD.org>2016-01-09 11:41:37 +0000
commitfda8b5679f4c51f90429e73fa1e8671b353e737a (patch)
tree0dc4f73b79afdd2db65e75c912a601bce8dc7e42 /sys/netinet6
parent14cf7637d13898951746bfe88c375cc7f7c9983f (diff)
downloadFreeBSD-src-fda8b5679f4c51f90429e73fa1e8671b353e737a.zip
FreeBSD-src-fda8b5679f4c51f90429e73fa1e8671b353e737a.tar.gz
Remove prefix check from in6_addroute().
This check was added in initial? netinet6/ import back in 1999 (r53541). It effectively became unnecessary after 'address/prefix clean-ups' KAME commit 90ff8792e676132096a440dd787f99a5a5860ee8 (github) in 2001 (merged to FreeBSD in r78064) where prefix check was added to nd6_prefix_onlink(). Similar IPv4 check (in_addroute() was added in r137628). Additionally, the right plance for this (or similar) check is the prefix addition code (nd6_prefix_onlink(), nd6_prefix_onlink_rtrequest(), in_addprefix() or rtinit()), but not the generic radix insert routine.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6_rmx.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
index 97e12162..93c786c 100644
--- a/sys/netinet6/in6_rmx.c
+++ b/sys/netinet6/in6_rmx.c
@@ -107,7 +107,6 @@ in6_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
{
struct rtentry *rt = (struct rtentry *)treenodes;
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)rt_key(rt);
- struct radix_node *ret;
RADIX_NODE_HEAD_WLOCK_ASSERT(head);
if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
@@ -148,34 +147,7 @@ in6_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp);
}
- ret = rn_addroute(v_arg, n_arg, head, treenodes);
- if (ret == NULL) {
- struct rtentry *rt2;
- /*
- * We are trying to add a net route, but can't.
- * The following case should be allowed, so we'll make a
- * special check for this:
- * Two IPv6 addresses with the same prefix is assigned
- * to a single interrface.
- * # ifconfig if0 inet6 3ffe:0501::1 prefix 64 alias (*1)
- * # ifconfig if0 inet6 3ffe:0501::2 prefix 64 alias (*2)
- * In this case, (*1) and (*2) want to add the same
- * net route entry, 3ffe:0501:: -> if0.
- * This case should not raise an error.
- */
- rt2 = in6_rtalloc1((struct sockaddr *)sin6, 0, RTF_RNH_LOCKED,
- rt->rt_fibnum);
- if (rt2) {
- if (((rt2->rt_flags & (RTF_HOST|RTF_GATEWAY)) == 0)
- && rt2->rt_gateway
- && rt2->rt_gateway->sa_family == AF_LINK
- && rt2->rt_ifp == rt->rt_ifp) {
- ret = rt2->rt_nodes;
- }
- RTFREE_LOCKED(rt2);
- }
- }
- return (ret);
+ return (rn_addroute(v_arg, n_arg, head, treenodes));
}
/*
OpenPOWER on IntegriCloud