Commit 8d65b119 authored by Duan Jiong's avatar Duan Jiong Committed by David S. Miller

net: raw: do not report ICMP redirects to user space

Redirect isn't an error condition, it should leave
the error handler without touching the socket.
Signed-off-by: default avatarDuan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1a462d18
...@@ -218,8 +218,10 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info) ...@@ -218,8 +218,10 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info)
if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)
ipv4_sk_update_pmtu(skb, sk, info); ipv4_sk_update_pmtu(skb, sk, info);
else if (type == ICMP_REDIRECT) else if (type == ICMP_REDIRECT) {
ipv4_sk_redirect(skb, sk); ipv4_sk_redirect(skb, sk);
return;
}
/* Report error on raw socket, if: /* Report error on raw socket, if:
1. User requested ip_recverr. 1. User requested ip_recverr.
......
...@@ -335,8 +335,10 @@ static void rawv6_err(struct sock *sk, struct sk_buff *skb, ...@@ -335,8 +335,10 @@ static void rawv6_err(struct sock *sk, struct sk_buff *skb,
ip6_sk_update_pmtu(skb, sk, info); ip6_sk_update_pmtu(skb, sk, info);
harderr = (np->pmtudisc == IPV6_PMTUDISC_DO); harderr = (np->pmtudisc == IPV6_PMTUDISC_DO);
} }
if (type == NDISC_REDIRECT) if (type == NDISC_REDIRECT) {
ip6_sk_redirect(skb, sk); ip6_sk_redirect(skb, sk);
return;
}
if (np->recverr) { if (np->recverr) {
u8 *payload = skb->data; u8 *payload = skb->data;
if (!inet->hdrincl) if (!inet->hdrincl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment