diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-10-12 20:03:56 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-10-12 20:03:56 +0000 |
commit | cf6eacbc1ebd740b165741a185669e9659e85e14 (patch) | |
tree | f759851c9141151bf3d53d1a0f6d5261076d3b4c /sys/netinet/udp_usrreq.c | |
parent | 94ad1578b058cd457e65b44ba62ae4619b083ce8 (diff) | |
download | FreeBSD-src-cf6eacbc1ebd740b165741a185669e9659e85e14.zip FreeBSD-src-cf6eacbc1ebd740b165741a185669e9659e85e14.tar.gz |
Don't release the udbinfo lock until after the last use of UDP inpcb
in udp_input(), since the udbinfo lock is used to prevent removal of
the inpcb while in use (i.e., as a form of reference count) in the
in-bound path.
RELENG_5 candidate.
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 9c02395..26a804d 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -363,9 +363,9 @@ udp_input(m, off) udpstat.udps_noportbcast++; goto badheadlocked; } - INP_INFO_RUNLOCK(&udbinfo); udp_append(last, ip, m, iphlen + sizeof(struct udphdr)); INP_UNLOCK(last); + INP_INFO_RUNLOCK(&udbinfo); return; } /* @@ -399,15 +399,15 @@ udp_input(m, off) return; } INP_LOCK(inp); - INP_INFO_RUNLOCK(&udbinfo); udp_append(inp, ip, m, iphlen + sizeof(struct udphdr)); INP_UNLOCK(inp); + INP_INFO_RUNLOCK(&udbinfo); return; badheadlocked: - INP_INFO_RUNLOCK(&udbinfo); if (inp) INP_UNLOCK(inp); + INP_INFO_RUNLOCK(&udbinfo); badunlocked: m_freem(m); if (opts) |