diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-02-01 04:40:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-01 04:40:17 -0500 |
commit | 5add300975cf36b1bd30c461105bb938da260f14 (patch) | |
tree | 4d9bde7687e838a23ba6c1f0b2c3c97322fa6b5d /net/ipv4 | |
parent | ad0f9904444de1309dedd2b9e365cae8af77d9b1 (diff) |
inet: Fix virt-manager regression due to bind(0) changes.
From: Stephen Hemminger <shemminger@vyatta.com>
Fix regression introduced by a9d8f9110d7e953c2f2b521087a4179677843c2a
("inet: Allowing more than 64k connections and heavily optimize
bind(0) time.")
Based upon initial patches and feedback from Evegniy Polyakov and
Eric Dumazet.
From Eric Dumazet:
--------------------
Also there might be a problem at line 175
if (sk->sk_reuse && sk->sk_state != TCP_LISTEN && --attempts >= 0) {
spin_unlock(&head->lock);
goto again;
If we entered inet_csk_get_port() with a non null snum, we can "goto again"
while it was not expected.
--------------------
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index df8e72f07478..9bc6a187bdce 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -172,7 +172,8 @@ tb_found: | |||
172 | } else { | 172 | } else { |
173 | ret = 1; | 173 | ret = 1; |
174 | if (inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) { | 174 | if (inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) { |
175 | if (sk->sk_reuse && sk->sk_state != TCP_LISTEN && --attempts >= 0) { | 175 | if (sk->sk_reuse && sk->sk_state != TCP_LISTEN && |
176 | smallest_size != -1 && --attempts >= 0) { | ||
176 | spin_unlock(&head->lock); | 177 | spin_unlock(&head->lock); |
177 | goto again; | 178 | goto again; |
178 | } | 179 | } |