Date: Tue, 16 Dec 2008 03:05:18 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186162 - head/sys/netinet6 Message-ID: <200812160305.mBG35Ixe024731@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kmacy Date: Tue Dec 16 03:05:18 2008 New Revision: 186162 URL: http://svn.freebsd.org/changeset/base/186162 Log: simplify locking in find_pfxlist_reachable_router Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Tue Dec 16 02:48:12 2008 (r186161) +++ head/sys/netinet6/nd6_rtr.c Tue Dec 16 03:05:18 2008 (r186162) @@ -1329,19 +1329,20 @@ find_pfxlist_reachable_router(struct nd_ { struct nd_pfxrouter *pfxrtr; struct llentry *ln; + int canreach; for (pfxrtr = LIST_FIRST(&pr->ndpr_advrtrs); pfxrtr; pfxrtr = LIST_NEXT(pfxrtr, pfr_entry)) { IF_AFDATA_LOCK(pfxrtr->router->ifp); - if (((ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, - pfxrtr->router->ifp)) != NULL) && - ND6_IS_LLINFO_PROBREACH(ln)) { - LLE_RUNLOCK(ln); - break; /* found */ - } - if (ln != NULL) - LLE_RUNLOCK(ln); + ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); IF_AFDATA_UNLOCK(pfxrtr->router->ifp); + canreach = 0; + if (ln != NULL) { + canreach = ND6_IS_LLINFO_PROBREACH(ln); + LLE_RUNLOCK(ln); + } + if (canreach) + break; } return (pfxrtr); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812160305.mBG35Ixe024731>