-/* $OpenBSD: if_ethersubr.c,v 1.287 2023/02/06 20:27:45 jan Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.288 2023/04/05 23:01:03 kn Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
break;
#ifdef INET6
case AF_INET6:
- KERNEL_LOCK();
- /* XXXSMP there is a MP race in nd6_resolve() */
error = nd6_resolve(ifp, rt, m, dst, eh->ether_dhost);
- KERNEL_UNLOCK();
if (error)
return (error);
eh->ether_type = htons(ETHERTYPE_IPV6);
break;
#ifdef INET6
case AF_INET6:
- KERNEL_LOCK();
- /* XXXSMP there is a MP race in nd6_resolve() */
error = nd6_resolve(ifp, rt, m, dst, eh->ether_dhost);
- KERNEL_UNLOCK();
if (error)
return (error);
break;
-/* $OpenBSD: nd6.c,v 1.271 2023/04/05 21:51:47 bluhm Exp $ */
+/* $OpenBSD: nd6.c,v 1.272 2023/04/05 23:01:03 kn Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
return (0);
}
+ /* XXXSMP there is a MP race in nd6_resolve() */
+ KERNEL_LOCK();
uptime = getuptime();
rt = rt_getll(rt0);
if (ISSET(rt->rt_flags, RTF_REJECT) &&
(rt->rt_expire == 0 || rt->rt_expire > uptime)) {
m_freem(m);
+ KERNEL_UNLOCK();
return (rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
}
}
bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
+ KERNEL_UNLOCK();
return (0);
}
nd6_llinfo_settimer(ln, RETRANS_TIMER / 1000);
nd6_ns_output(ifp, NULL, &satosin6(dst)->sin6_addr, ln, 0);
}
+ KERNEL_UNLOCK();
return (EAGAIN);
bad:
m_freem(m);
+ KERNEL_UNLOCK();
return (EINVAL);
}