From 6b8e5a9862449d5409d085ba4f9d420e6d524f5c Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Tue, 12 Oct 2004 20:03:56 +0000 Subject: [PATCH] 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. --- sys/netinet/udp_usrreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 9c02395a2a14..26a804da42f4 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)