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
This commit is contained in:
truckman 2004-01-10 08:14:27 +00:00
parent 32541d6d0a
commit b269153dd4

View File

@ -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