kernel-ark/net/sunrpc
Chris Perl 0f7a622ca6 rpc: xs_bind - do not bind when requesting a random ephemeral port
When attempting to establish a local ephemeral endpoint for a TCP or UDP
socket, do not explicitly call bind, instead let it happen implicilty when the
socket is first used.

The main motivating factor for this change is when TCP runs out of unique
ephemeral ports (i.e.  cannot find any ephemeral ports which are not a part of
*any* TCP connection).  In this situation if you explicitly call bind, then the
call will fail with EADDRINUSE.  However, if you allow the allocation of an
ephemeral port to happen implicitly as part of connect (or other functions),
then ephemeral ports can be reused, so long as the combination of (local_ip,
local_port, remote_ip, remote_port) is unique for TCP sockets on the system.

This doesn't matter for UDP sockets, but it seemed easiest to treat TCP and UDP
sockets the same.

This can allow mount.nfs(8) to continue to function successfully, even in the
face of misbehaving applications which are creating a large number of TCP
connections.

Signed-off-by: Chris Perl <chris.perl@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2014-09-10 12:47:00 -07:00
..
auth_gss NFS client updates for Linux 3.17 2014-08-13 18:13:19 -06:00
xprtrdma NFS client updates for Linux 3.17 2014-08-13 18:13:19 -06:00
addr.c replace strict_strto calls 2014-07-12 18:45:49 -04:00
auth_generic.c sunrpc/auth: allow lockless (rcu) lookup of credential cache. 2014-08-03 17:14:12 -04:00
auth_null.c sunrpc/auth: allow lockless (rcu) lookup of credential cache. 2014-08-03 17:14:12 -04:00
auth_unix.c
auth.c SUNRPC: remove all refcounting of groupinfo from rpcauth_lookupcred 2014-08-04 09:22:08 -04:00
backchannel_rqst.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
bc_svc.c
cache.c SUNRPC: Fix printk that is not only for nfsd 2014-05-08 14:59:51 -04:00
clnt.c SUNRPC: Handle EPIPE in xprt_connect_status 2014-07-03 00:11:35 -04:00
Kconfig xprtrdma: add separate Kconfig options for NFSoRDMA client and server support 2014-03-28 18:02:12 -04:00
Makefile xprtrdma: add separate Kconfig options for NFSoRDMA client and server support 2014-03-28 18:02:12 -04:00
netns.h Merge branch 'for-3.14' of git://linux-nfs.org/~bfields/linux 2014-01-30 10:18:43 -08:00
rpc_pipe.c rpc_pipe: Drop memory allocation cast 2014-07-12 18:43:44 -04:00
rpcb_clnt.c
sched.c sched: Allow wait_on_bit_action() functions to support a timeout 2014-07-16 15:10:41 +02:00
socklib.c net: Save software checksum complete 2014-06-11 15:46:13 -07:00
stats.c
sunrpc_syms.c
sunrpc.h SUNRPC: track whether a request is coming from a loop-back interface. 2014-05-22 15:59:18 -04:00
svc_xprt.c SUNRPC: Allow svc_reserve() to notify TCP socket that space has been freed 2014-07-29 16:10:20 -04:00
svc.c SUNRPC/NFSD: Change to type of bool for rq_usedeferral and rq_splice_ok 2014-06-23 11:31:36 -04:00
svcauth_unix.c
svcauth.c nfsd4: better reservation of head space for krb5 2014-05-30 17:32:17 -04:00
svcsock.c SUNRPC: Allow svc_reserve() to notify TCP socket that space has been freed 2014-07-29 16:10:20 -04:00
sysctl.c
timer.c
xdr.c SUNRPC: xdr_get_next_encode_buffer should be declared static 2014-07-18 11:35:46 -04:00
xprt.c NFS client updates for Linux 3.17 2014-08-13 18:13:19 -06:00
xprtsock.c rpc: xs_bind - do not bind when requesting a random ephemeral port 2014-09-10 12:47:00 -07:00