diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-04 13:55:22 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-04 13:55:22 -0700 |
commit | f6e63cfb5cfcccca510672155b90dd39bf45a35f (patch) | |
tree | bc15910c506a87a89eb0bf4392d9a6175ff4e402 /net/ipv6 | |
parent | fad1c45c939bb246a488be1fa06f539e85b80545 (diff) | |
parent | e6308be85afee685347fa3440bed10faaa5d6c1a (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/udp.c | 4 |
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 { |