aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 25309b137c43..a84f74af22f7 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -271,10 +271,13 @@ EXPORT_SYMBOL(tcp_v4_connect);
271 */ 271 */
272void tcp_v4_mtu_reduced(struct sock *sk) 272void tcp_v4_mtu_reduced(struct sock *sk)
273{ 273{
274 struct dst_entry *dst;
275 struct inet_sock *inet = inet_sk(sk); 274 struct inet_sock *inet = inet_sk(sk);
276 u32 mtu = tcp_sk(sk)->mtu_info; 275 struct dst_entry *dst;
276 u32 mtu;
277 277
278 if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE))
279 return;
280 mtu = tcp_sk(sk)->mtu_info;
278 dst = inet_csk_update_pmtu(sk, mtu); 281 dst = inet_csk_update_pmtu(sk, mtu);
279 if (!dst) 282 if (!dst)
280 return; 283 return;
@@ -420,7 +423,8 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
420 423
421 switch (type) { 424 switch (type) {
422 case ICMP_REDIRECT: 425 case ICMP_REDIRECT:
423 do_redirect(icmp_skb, sk); 426 if (!sock_owned_by_user(sk))
427 do_redirect(icmp_skb, sk);
424 goto out; 428 goto out;
425 case ICMP_SOURCE_QUENCH: 429 case ICMP_SOURCE_QUENCH:
426 /* Just silently ignore these. */ 430 /* Just silently ignore these. */