diff options
-rw-r--r-- | net/dccp/ipv4.c | 3 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 8 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 3 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 8 |
4 files changed, 14 insertions, 8 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index edbe59d203ef..86b0933ecd45 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -289,7 +289,8 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) | |||
289 | 289 | ||
290 | switch (type) { | 290 | switch (type) { |
291 | case ICMP_REDIRECT: | 291 | case ICMP_REDIRECT: |
292 | dccp_do_redirect(skb, sk); | 292 | if (!sock_owned_by_user(sk)) |
293 | dccp_do_redirect(skb, sk); | ||
293 | goto out; | 294 | goto out; |
294 | case ICMP_SOURCE_QUENCH: | 295 | case ICMP_SOURCE_QUENCH: |
295 | /* Just silently ignore these. */ | 296 | /* Just silently ignore these. */ |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 7506c03a7db9..237d62c493e3 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -122,10 +122,12 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
122 | np = inet6_sk(sk); | 122 | np = inet6_sk(sk); |
123 | 123 | ||
124 | if (type == NDISC_REDIRECT) { | 124 | if (type == NDISC_REDIRECT) { |
125 | struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie); | 125 | if (!sock_owned_by_user(sk)) { |
126 | struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie); | ||
126 | 127 | ||
127 | if (dst) | 128 | if (dst) |
128 | dst->ops->redirect(dst, sk, skb); | 129 | dst->ops->redirect(dst, sk, skb); |
130 | } | ||
129 | goto out; | 131 | goto out; |
130 | } | 132 | } |
131 | 133 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 5bb809f12ba1..6988566dc72f 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -421,7 +421,8 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) | |||
421 | 421 | ||
422 | switch (type) { | 422 | switch (type) { |
423 | case ICMP_REDIRECT: | 423 | case ICMP_REDIRECT: |
424 | do_redirect(icmp_skb, sk); | 424 | if (!sock_owned_by_user(sk)) |
425 | do_redirect(icmp_skb, sk); | ||
425 | goto out; | 426 | goto out; |
426 | case ICMP_SOURCE_QUENCH: | 427 | case ICMP_SOURCE_QUENCH: |
427 | /* Just silently ignore these. */ | 428 | /* Just silently ignore these. */ |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 667396536feb..b2e61a0e8d0a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -375,10 +375,12 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
375 | np = inet6_sk(sk); | 375 | np = inet6_sk(sk); |
376 | 376 | ||
377 | if (type == NDISC_REDIRECT) { | 377 | if (type == NDISC_REDIRECT) { |
378 | struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie); | 378 | if (!sock_owned_by_user(sk)) { |
379 | struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie); | ||
379 | 380 | ||
380 | if (dst) | 381 | if (dst) |
381 | dst->ops->redirect(dst, sk, skb); | 382 | dst->ops->redirect(dst, sk, skb); |
383 | } | ||
382 | goto out; | 384 | goto out; |
383 | } | 385 | } |
384 | 386 | ||