]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: bind() fix autoselection to share ports
authorFlavio Leitner <fbl@redhat.com>
Wed, 25 Jan 2012 08:34:51 +0000 (08:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Jan 2012 02:50:43 +0000 (21:50 -0500)
commit68784bcb2fea16d9cb52b42d3c7d3780dcc18a8c
tree0f180ef1fa0efcea96738315917eaa014c2ac8f0
parent1fcff103fc669ffc5effa9a38d0f2121dc79668a
tcp: bind() fix autoselection to share ports

The current code checks for conflicts when the application
requests a specific port.  If there is no conflict, then
the request is granted.

On the other hand, the port autoselection done by the kernel
fails when all ports are bound even when there is a port
with no conflict available.

The fix changes port autoselection to check if there is a
conflict and use it if not.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inet_connection_sock.c