Date: Wed, 12 Sep 2007 09:10:11 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 126332 for review Message-ID: <200709120910.l8C9ABr1097841@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126332 Change 126332 by kmacy@kmacy_home:ethng on 2007/09/12 09:09:19 acquire the rnh lock shared for the lookup and matchaddr case Affected files ... .. //depot/projects/ethng/src/sys/net/route.c#3 edit .. //depot/projects/ethng/src/sys/net/rtsock.c#3 edit Differences ... ==== //depot/projects/ethng/src/sys/net/route.c#3 (text+ko) ==== @@ -144,7 +144,7 @@ rtstat.rts_unreach++; goto miss2; } - RADIX_NODE_HEAD_LOCK(rnh); + RADIX_NODE_HEAD_LOCK_SHARED(rnh); if ((rn = rnh->rnh_matchaddr(dst, rnh)) && (rn->rn_flags & RNF_ROOT) == 0) { /* @@ -197,7 +197,7 @@ RT_LOCK(newrt); RT_ADDREF(newrt); } - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_UNLOCK_SHARED(rnh); } else { /* * Either we hit the root or couldn't find any match, @@ -206,7 +206,7 @@ */ rtstat.rts_unreach++; miss: - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_UNLOCK_SHARED(rnh); miss2: if (report) { /* * If required, report the failure to the supervising @@ -1190,12 +1190,12 @@ */ if ((rnh = rt_tables[dst->sa_family]) == NULL) goto bad; - RADIX_NODE_HEAD_LOCK(rnh); + RADIX_NODE_HEAD_LOCK_SHARED(rnh); error = ((rn = rnh->rnh_lookup(dst, netmask, rnh)) == NULL || (rn->rn_flags & RNF_ROOT) || RNTORT(rn)->rt_ifa != ifa || !sa_equal((struct sockaddr *)rn->rn_key, dst)); - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_UNLOCK_SHARED(rnh); if (error) { bad: if (m) ==== //depot/projects/ethng/src/sys/net/rtsock.c#3 (text+ko) ==== @@ -413,16 +413,16 @@ rnh = rt_tables[info.rti_info[RTAX_DST]->sa_family]; if (rnh == NULL) senderr(EAFNOSUPPORT); - RADIX_NODE_HEAD_LOCK(rnh); + RADIX_NODE_HEAD_LOCK_SHARED(rnh); rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST], info.rti_info[RTAX_NETMASK], rnh); if (rt == NULL) { /* XXX looks bogus */ - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_UNLOCK_SHARED(rnh); senderr(ESRCH); } RT_LOCK(rt); RT_ADDREF(rt); - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_UNLOCK_SHARED(rnh); /* * Fix for PR: 82974
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709120910.l8C9ABr1097841>