diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-10-11 09:29:48 +0100 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-10-11 09:29:48 +0100 |
commit | 29d8699ebb1e8948a612306c69e6d9c4ef23342f (patch) | |
tree | f2378e8d2fbef7fc215a25acf2042b8965109e5e /net/ipv6/udp.c | |
parent | e9438250b635f7832e99a8c8d2e394dd1522ce65 (diff) | |
parent | 907a42617970a159361f17ef9a63f04d276995ab (diff) | |
download | op-kernel-dev-29d8699ebb1e8948a612306c69e6d9c4ef23342f.zip op-kernel-dev-29d8699ebb1e8948a612306c69e6d9c4ef23342f.tar.gz |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'net/ipv6/udp.c')
-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 e4cad11..bf95193 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 { |