summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-07-07 09:26:52 +0000
committerrwatson <rwatson@FreeBSD.org>2008-07-07 09:26:52 +0000
commit551285191e25159705e99dbcf30b95ab0d92f29e (patch)
tree1d7c5eb3410b82baa083a5caef1e8ca05434372e /sys/netinet
parentea74539fbc8e15c5f08d274a44fab9597bd721a8 (diff)
downloadFreeBSD-src-551285191e25159705e99dbcf30b95ab0d92f29e.zip
FreeBSD-src-551285191e25159705e99dbcf30b95ab0d92f29e.tar.gz
Drop read lock on udbinfo earlier during delivery to the last matching
UDP socket for a datagram; the inpcb read lock is sufficient to provide inpcb stability during udp_append(). MFC after: 1 month
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/udp_usrreq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 4479a50..f63fd0b 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -542,11 +542,13 @@ udp_input(struct mbuf *m, int off)
* Check the minimum TTL for socket.
*/
INP_RLOCK(inp);
- if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl)
- goto badheadlocked;
+ INP_INFO_RUNLOCK(&udbinfo);
+ if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) {
+ INP_RUNLOCK(inp);
+ goto badunlocked;
+ }
udp_append(inp, ip, m, iphlen + sizeof(struct udphdr), &udp_in);
INP_RUNLOCK(inp);
- INP_INFO_RUNLOCK(&udbinfo);
return;
badheadlocked:
OpenPOWER on IntegriCloud