linux_old1/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
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
addr.c replace strict_strto calls 2014-07-12 18:45:49 -04:00
auth.c SUNRPC: remove all refcounting of groupinfo from rpcauth_lookupcred 2014-08-04 09:22:08 -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 SUNRPC refactor rpcauth_checkverf error returns 2013-09-03 15:25:09 -04:00
backchannel_rqst.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
bc_svc.c SUNRPC: remove BUG_ON from bc_send 2012-11-04 14:43:41 -05:00
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
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 SUNRPC: If the rpcbind channel is disconnected, fail the call to unregister 2013-08-07 17:07:18 -04:00
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: Deprecate rpc_client->cl_protname 2013-08-30 09:19:34 -04:00
sunrpc.h SUNRPC: track whether a request is coming from a loop-back interface. 2014-05-22 15:59:18 -04:00
sunrpc_syms.c sunrpc: create a new dummy pipe for gssd to hold open 2013-12-06 13:06:30 -05: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
svc_xprt.c SUNRPC: Allow svc_reserve() to notify TCP socket that space has been freed 2014-07-29 16:10:20 -04:00
svcauth.c nfsd4: better reservation of head space for krb5 2014-05-30 17:32:17 -04:00
svcauth_unix.c svcrpc: fix failures to handle -1 uid's 2013-07-08 17:27:23 -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 net: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00
timer.c net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
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