aboutsummaryrefslogtreecommitdiff
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-10-11 09:29:48 +0100
committerAnton Altaparmakov <aia21@cantab.net>2005-10-11 09:29:48 +0100
commit29d8699ebb1e8948a612306c69e6d9c4ef23342f (patch)
treef2378e8d2fbef7fc215a25acf2042b8965109e5e /net/ipv6/udp.c
parente9438250b635f7832e99a8c8d2e394dd1522ce65 (diff)
parent907a42617970a159361f17ef9a63f04d276995ab (diff)
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index e4cad11f284..bf9519341fd 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -99,7 +99,7 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum)
next:;
}
result = best;
- for(;; result += UDP_HTABLE_SIZE) {
+ for(i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++, result += UDP_HTABLE_SIZE) {
if (result > sysctl_local_port_range[1])
result = sysctl_local_port_range[0]
+ ((result - sysctl_local_port_range[0]) &
@@ -107,6 +107,8 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum)
if (!udp_lport_inuse(result))
break;
}
+ if (i >= (1 << 16) / UDP_HTABLE_SIZE)
+ goto fail;
gotit:
udp_port_rover = snum = result;
} else {