diff options
| author | Chris Perl <chris.perl@gmail.com> | 2014-09-15 14:02:25 -0400 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2014-09-16 09:12:27 -0400 |
| commit | 05fc73859eacc96d846f5ef91cae5b8bac5f564e (patch) | |
| tree | 5f924e1f7e2bf0fa93dd3cbfd265f4c6ac6c4b32 /utils | |
| parent | 8399548e6b904116e0e41d83e4a4b571af8ea578 (diff) | |
| download | nfs-utils-05fc73859eacc96d846f5ef91cae5b8bac5f564e.tar.gz nfs-utils-05fc73859eacc96d846f5ef91cae5b8bac5f564e.tar.xz nfs-utils-05fc73859eacc96d846f5ef91cae5b8bac5f564e.zip | |
nfs_get_tcpclient/nfs_get_udpclient - make bind(2) implicit
When attempting to establish a local ephemeral endpoint for a TCP or UDP
socket, do not explicitly call bind(2), 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(2), then the call will fail with EADDRINUSE. However, if you allow the
allocation of an ephemeral port to happen implicitly as part of connect(2)
(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: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils')
0 files changed, 0 insertions, 0 deletions
