From 5f16e341d4d680d0cce8210a97d0ba58fb6f2a8e Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Wed, 4 Feb 2009 10:35:27 +0000 Subject: [PATCH] When iterating through the list trying to find a router in defrouter_select(), NULL the cached llentry after unlocking as we are no longer interested in it and with the second iteration would try to unlock it again resulting in panic: Lock (rw) lle not locked @ ... Reported by: Mark Atkinson Tested by: Mark Atkinson PR: kern/128247 (in follow-up, unrelated to original report) --- sys/netinet6/nd6_rtr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 2f2d2ffa3df..2bf47d25ded 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -651,8 +651,10 @@ defrouter_select(void) selected_dr = dr; } IF_AFDATA_UNLOCK(dr->ifp); - if (ln != NULL) + if (ln != NULL) { LLE_RUNLOCK(ln); + ln = NULL; + } if (dr->installed && installed_dr == NULL) installed_dr = dr;