summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2004-01-10 08:14:27 +0000
committertruckman <truckman@FreeBSD.org>2004-01-10 08:14:27 +0000
commit12dea7eecf9f3819c08c18ddb59322a965f59512 (patch)
treeadf115f96d27623e6a1ebd66095664539263b05d
parenta48a902f6fb84764c5f082cfbf9d5a5f2d805113 (diff)
downloadFreeBSD-src-12dea7eecf9f3819c08c18ddb59322a965f59512.zip
FreeBSD-src-12dea7eecf9f3819c08c18ddb59322a965f59512.tar.gz
Don't execute the code in in6_ifdetach() that removes the link-local
allnodes multicast route if the routing table has not been initialized. This avoids a panic during boot if an interface detaches before the routing table is initialized. Submitted by: sam
-rw-r--r--sys/netinet6/in6_ifattach.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index ea0db8b..7f1788c 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -843,14 +843,16 @@ in6_ifdetach(ifp)
sin6.sin6_addr = in6addr_linklocal_allnodes;
sin6.sin6_addr.s6_addr16[1] = htons(ifp->if_index);
/* XXX grab lock first to avoid LOR */
- RADIX_NODE_HEAD_LOCK(rt_tables[AF_INET6]);
- rt = rtalloc1((struct sockaddr *)&sin6, 0, 0UL);
- if (rt) {
- if (rt->rt_ifp == ifp)
- rtexpunge(rt);
- RTFREE_LOCKED(rt);
+ if (rt_tables[AF_INET6] != NULL) {
+ RADIX_NODE_HEAD_LOCK(rt_tables[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[AF_INET6]);
}
void
OpenPOWER on IntegriCloud