]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Disconnect a temporarily-connected UDP socket in out-of-mbufs case. This
authorbms <bms@FreeBSD.org>
Wed, 16 Jun 2004 05:41:00 +0000 (05:41 +0000)
committerbms <bms@FreeBSD.org>
Wed, 16 Jun 2004 05:41:00 +0000 (05:41 +0000)
commitdeb499d51d32f9cec3bfdb35cc09c01a9c33681c
treebf592caed9fb0bab85e1c90f9c915df5e15b9702
parent4902310dd73041506db8a950229fba9e53fec5a7
Disconnect a temporarily-connected UDP socket in out-of-mbufs case. This
fixes the problem of UDP sockets getting wedged in a connected state (and
bound to their destination) under heavy load.
Temporary bind/connect should probably be deleted in future
as an optimization, as described in "A Faster UDP" [Partridge/Pink 1993].

Notes:
 - INP_LOCK() is already held in udp_output(). The connection is in effect
   happening at a layer lower than the socket layer, therefore in theory
   socket locking should not be needed.
 - Inlining the in_pcbdisconnect() operation buys us nothing (in the case
   of the current state of the code), as laddr is not part of the
   inpcb hash or the udbinfo hash. Therefore there should be no need
   to rehash after restoring laddr in the error case (this was a
   concern of the original author of the patch).

PR: kern/41765
Requested by: gnn
Submitted by: Jinmei Tatuya (with cleanups)
Tested by: spray(8)
sys/netinet/udp_usrreq.c