]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: bind() fix when many ports are bound
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 21 Apr 2010 09:26:15 +0000 (09:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Apr 2010 02:06:06 +0000 (19:06 -0700)
commitf4899d0dac5bcdf21b7dd13b55e0c58c6e1262ed
treef749b26dea4353c6f3bd95e49fafceb06623c20b
parent2b30980b8c690b3a51d0d1ca99684586c391c1ee
tcp: bind() fix when many ports are bound

Port autoselection done by kernel only works when number of bound
sockets is under a threshold (typically 30000).

When this threshold is over, we must check if there is a conflict before
exiting first loop in inet_csk_get_port()

Change inet_csk_bind_conflict() to forbid two reuse-enabled sockets to
bind on same (address,port) tuple (with a non ANY address)

Same change for inet6_csk_bind_conflict()

Reported-by: Gaspar Chilingarov <gasparch@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inet_connection_sock.c
net/ipv6/inet6_connection_sock.c