Date: Mon, 18 Aug 2003 18:12:09 -0700 (PDT) From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 36386 for review Message-ID: <200308190112.h7J1C97d048558@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=36386 Change 36386 by sam@sam_ebb on 2003/08/18 18:12:06 correct locking assumptions about callbacks through rnh_close: the rtentry is supplied locked Affected files ... .. //depot/projects/netperf/sys/netinet/in_rmx.c#3 edit .. //depot/projects/netperf/sys/netinet6/in6_rmx.c#3 edit Differences ... ==== //depot/projects/netperf/sys/netinet/in_rmx.c#3 (text+ko) ==== @@ -193,7 +193,8 @@ { struct rtentry *rt = (struct rtentry *)rn; - /*XXX locking? */ + RT_LOCK_ASSERT(rt, MA_OWNED); + if (!(rt->rt_flags & RTF_UP)) return; /* prophylactic measures */ @@ -208,10 +209,8 @@ * waiting for a timeout cycle to kill it. */ if (rtq_reallyold != 0) { - RT_LOCK(rt); rt->rt_flags |= RTPRF_OURS; rt->rt_rmx.rmx_expire = time_second + rtq_reallyold; - RT_UNLOCK(rt); } else { rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), ==== //depot/projects/netperf/sys/netinet6/in6_rmx.c#3 (text+ko) ==== @@ -252,6 +252,8 @@ { struct rtentry *rt = (struct rtentry *)rn; + RT_LOCK_ASSERT(rt, MA_OWNED); + if (!(rt->rt_flags & RTF_UP)) return; /* prophylactic measures */ @@ -267,10 +269,8 @@ * waiting for a timeout cycle to kill it. */ if (rtq_reallyold != 0) { - RT_LOCK(rt); rt->rt_flags |= RTPRF_OURS; rt->rt_rmx.rmx_expire = time_second + rtq_reallyold; - RT_UNLOCK(rt); } else { rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308190112.h7J1C97d048558>