mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
[TCP]: Optimize check in port-allocation code, v6 version.
Signed-off-by: Folkert van Heusden <folkert@vanheusden.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0b2531bdc5
commit
c3924c70dd
@ -139,9 +139,12 @@ static int tcp_v6_get_port(struct sock *sk, unsigned short snum)
|
||||
int rover;
|
||||
|
||||
spin_lock(&tcp_portalloc_lock);
|
||||
rover = tcp_port_rover;
|
||||
if (tcp_port_rover < low)
|
||||
rover = low;
|
||||
else
|
||||
rover = tcp_port_rover;
|
||||
do { rover++;
|
||||
if ((rover < low) || (rover > high))
|
||||
if (rover > high)
|
||||
rover = low;
|
||||
head = &tcp_bhash[tcp_bhashfn(rover)];
|
||||
spin_lock(&head->lock);
|
||||
|
Loading…
Reference in New Issue
Block a user