Date: Wed, 12 Sep 2007 23:38:16 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 126346 for review Message-ID: <200709122338.l8CNcGXP095985@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126346 Change 126346 by kmacy@kmacy_home:ethng on 2007/09/12 23:38:04 narrow the scope of the rnh lock so we don't recurse on it in rtrequest make sure we drop the route lock before destroying it Affected files ... .. //depot/projects/ethng/src/sys/net/route.c#4 edit Differences ... ==== //depot/projects/ethng/src/sys/net/route.c#4 (text+ko) ==== @@ -153,6 +153,7 @@ */ newrt = rt = RNTORT(rn); nflags = rt->rt_flags & ~ignflags; + RADIX_NODE_HEAD_UNLOCK_SHARED(rnh); if (report && (nflags & RTF_CLONING)) { /* * We are apparently adding (report = 0 in delete). @@ -162,12 +163,17 @@ err = rtrequest(RTM_RESOLVE, dst, NULL, NULL, 0, &newrt); if (err) { + RADIX_NODE_HEAD_LOCK_SHARED(rnh); + if (!((rn = rnh->rnh_matchaddr(dst, rnh)) && + (rn->rn_flags & RNF_ROOT) == 0)) + goto miss; /* * If the cloning didn't succeed, maybe * what we have will do. Return that. */ newrt = rt; /* existing route */ RT_LOCK(newrt); + RADIX_NODE_HEAD_UNLOCK_SHARED(rnh); RT_ADDREF(newrt); goto miss; } @@ -197,7 +203,6 @@ RT_LOCK(newrt); RT_ADDREF(newrt); } - RADIX_NODE_HEAD_UNLOCK_SHARED(rnh); } else { /* * Either we hit the root or couldn't find any match, @@ -297,6 +302,7 @@ /* * and the rtentry itself of course */ + RT_UNLOCK(rt); RT_LOCK_DESTROY(rt); uma_zfree(rtzone, rt); return;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709122338.l8CNcGXP095985>