summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6.c3
-rw-r--r--sys/netinet6/in6_ifattach.c6
-rw-r--r--sys/netinet6/in6_rmx.c12
-rw-r--r--sys/netinet6/nd6_rtr.c3
4 files changed, 15 insertions, 9 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index bcb634fb2ea1..c24ca20e00a5 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1708,7 +1708,8 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
rtp = &rt;
}
- error = rtrequest(RTM_ADD, (struct sockaddr *)&ia->ia_dstaddr,
+ error = rtrequest(RTM_ADD,
+ (struct sockaddr *)&ia->ia_dstaddr,
(struct sockaddr *)&ia->ia_addr,
(struct sockaddr *)&ia->ia_prefixmask,
ia->ia_flags | rtflags, rtp);
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index 6962deb46416..29dca4ffe61c 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -821,15 +821,15 @@ in6_ifdetach(struct ifnet *ifp)
/* XXX: should not fail */
return;
/* XXX grab lock first to avoid LOR */
- if (rt_tables[AF_INET6] != NULL) {
- RADIX_NODE_HEAD_LOCK(rt_tables[AF_INET6]);
+ if (rt_tables[0][AF_INET6] != NULL) {
+ RADIX_NODE_HEAD_LOCK(rt_tables[0][AF_INET6]);
rt = rtalloc1((struct sockaddr *)&sin6, 0, 0UL);
if (rt) {
if (rt->rt_ifp == ifp)
rtexpunge(rt);
RTFREE_LOCKED(rt);
}
- RADIX_NODE_HEAD_UNLOCK(rt_tables[AF_INET6]);
+ RADIX_NODE_HEAD_UNLOCK(rt_tables[0][AF_INET6]);
}
}
diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
index ea4c7ff322ea..1c0164f2f07f 100644
--- a/sys/netinet6/in6_rmx.c
+++ b/sys/netinet6/in6_rmx.c
@@ -449,17 +449,21 @@ in6_rtqdrain(void)
/*
* Initialize our routing tree.
+ * XXX MRT When off == 0, we are being called from vfs_export.c
+ * so just set up their table and leave. (we know what the correct
+ * value should be so just use that).. FIX AFTER RELENG_7 is MFC'd
+ * see also comments in in_inithead() vfs_export.c and domain.h
*/
int
in6_inithead(void **head, int off)
{
struct radix_node_head *rnh;
- if (!rn_inithead(head, off))
- return 0;
+ if (!rn_inithead(head, offsetof(struct sockaddr_in6, sin6_addr) << 3))
+ return 0; /* See above */
- if (head != (void **)&rt_tables[AF_INET6]) /* BOGUS! */
- return 1; /* only do this for the real routing table */
+ if (off == 0) /* See above */
+ return 1; /* only do the rest for the real thing */
rnh = *head;
rnh->rnh_addaddr = in6_addroute;
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 08f9a8311ad7..39f5382d6c33 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -2019,7 +2019,8 @@ in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6)
void
rt6_flush(struct in6_addr *gateway, struct ifnet *ifp)
{
- struct radix_node_head *rnh = rt_tables[AF_INET6];
+
+ struct radix_node_head *rnh = rt_tables[0][AF_INET6];
int s = splnet();
/* We'll care only link-local addresses */