mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
[TCP]: Optimize check in port-allocation code.
Signed-off-by: Folkert van Heusden <folkert@vanheusden.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
20cc6befa2
commit
0b2531bdc5
1 changed files with 5 additions and 2 deletions
|
@ -222,10 +222,13 @@ static int tcp_v4_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 a new issue