OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b2531b
)
[TCP]: Optimize check in port-allocation code, v6 version.
author
Folkert van Heusden
<folkert@vanheusden.com>
Tue, 3 May 2005 21:36:45 +0000
(14:36 -0700)
committer
David S. Miller
<davem@davemloft.net>
Tue, 3 May 2005 21:36:45 +0000
(14:36 -0700)
Signed-off-by: Folkert van Heusden <folkert@vanheusden.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/tcp_ipv6.c
patch
|
blob
|
history
diff --git
a/net/ipv6/tcp_ipv6.c
b/net/ipv6/tcp_ipv6.c
index
4760c85
..
0f69e80
100644
(file)
--- a/
net/ipv6/tcp_ipv6.c
+++ b/
net/ipv6/tcp_ipv6.c
@@
-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);