dccp/tcp: fix routing redirect race
[linux-2.6-microblaze.git] / net / ipv4 / tcp_ipv4.c
index 8f3ec13..575e19d 100644 (file)
@@ -431,7 +431,8 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
 
        switch (type) {
        case ICMP_REDIRECT:
-               do_redirect(icmp_skb, sk);
+               if (!sock_owned_by_user(sk))
+                       do_redirect(icmp_skb, sk);
                goto out;
        case ICMP_SOURCE_QUENCH:
                /* Just silently ignore these. */