From 12dea7eecf9f3819c08c18ddb59322a965f59512 Mon Sep 17 00:00:00 2001 From: truckman Date: Sat, 10 Jan 2004 08:14:27 +0000 Subject: 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 --- sys/netinet6/in6_ifattach.c | 16 +++++++++------- 1 file 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 -- cgit v1.1