diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index e1fd421060df..2d31419ef180 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -2315,6 +2315,7 @@ nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr, int family) { struct llentry *child_lle = NULL; struct llentry *lle, *lle_tmp; + static bool printed = false; lle = nd6_alloc(addr, 0, ifp); if (lle != NULL && family != AF_INET6) { @@ -2357,12 +2358,22 @@ 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); + if (!printed) { + printed = true; + printf("%s: found lle_tmp %p\n", __func__, lle_tmp); + } + 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 +2421,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