diff options
-rw-r--r-- | net/ipv4/udp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 1f9534846ca9..f0126fdd7e04 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -216,9 +216,8 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum, | |||
216 | * force rand to be an odd multiple of UDP_HTABLE_SIZE | 216 | * force rand to be an odd multiple of UDP_HTABLE_SIZE |
217 | */ | 217 | */ |
218 | rand = (rand | 1) * (udptable->mask + 1); | 218 | rand = (rand | 1) * (udptable->mask + 1); |
219 | for (last = first + udptable->mask + 1; | 219 | last = first + udptable->mask + 1; |
220 | first != last; | 220 | do { |
221 | first++) { | ||
222 | hslot = udp_hashslot(udptable, net, first); | 221 | hslot = udp_hashslot(udptable, net, first); |
223 | bitmap_zero(bitmap, PORTS_PER_CHAIN); | 222 | bitmap_zero(bitmap, PORTS_PER_CHAIN); |
224 | spin_lock_bh(&hslot->lock); | 223 | spin_lock_bh(&hslot->lock); |
@@ -238,7 +237,7 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum, | |||
238 | snum += rand; | 237 | snum += rand; |
239 | } while (snum != first); | 238 | } while (snum != first); |
240 | spin_unlock_bh(&hslot->lock); | 239 | spin_unlock_bh(&hslot->lock); |
241 | } | 240 | } while (++first != last); |
242 | goto fail; | 241 | goto fail; |
243 | } else { | 242 | } else { |
244 | hslot = udp_hashslot(udptable, net, snum); | 243 | hslot = udp_hashslot(udptable, net, snum); |