diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index e1fd421060df..945640929963 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -2357,12 +2357,18 @@ nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr, int family) } else { /* child lle already exists, free newly-created one */ lltable_free_entry(LLTABLE6(ifp), child_lle); + LLE_WLOCK(lle_tmp); child_lle = lle_tmp; } LLE_WUNLOCK(lle); lle = child_lle; + if (!rw_wowned(&lle->lle_lock)) + panic("lle %p not locked @ %s:%d!", lle, __FILE__, __LINE__); } IF_AFDATA_WUNLOCK(ifp); + + if (!rw_wowned(&lle->lle_lock)) + panic("lle %p not locked @ %s:%d!", lle, __FILE__, __LINE__); return (lle); } @@ -2410,7 +2416,8 @@ nd6_resolve_slow(struct ifnet *ifp, int family, int flags, struct mbuf *m, return (ENOBUFS); } - LLE_WLOCK_ASSERT(lle); + if (!rw_wowned(&lle->lle_lock)) + panic("lle %p not locked @ %s:%d!", lle, __FILE__, __LINE__); /* * The first time we send a packet to a neighbor whose entry is