Skip to content

Commit

Permalink
net: raw: do not report ICMP redirects to user space
Browse files Browse the repository at this point in the history
Redirect isn't an error condition, it should leave
the error handler without touching the socket.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Duan Jiong authored and David S. Miller committed Sep 24, 2013
1 parent 1a462d1 commit 8d65b11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion net/ipv4/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
ipv4_sk_update_pmtu(skb, sk, info);
else if (type == ICMP_REDIRECT)
else if (type == ICMP_REDIRECT) {
ipv4_sk_redirect(skb, sk);
return;
}

/* Report error on raw socket, if:
1. User requested ip_recverr.
Expand Down
4 changes: 3 additions & 1 deletion net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,10 @@ static void rawv6_err(struct sock *sk, struct sk_buff *skb,
ip6_sk_update_pmtu(skb, sk, info);
harderr = (np->pmtudisc == IPV6_PMTUDISC_DO);
}
if (type == NDISC_REDIRECT)
if (type == NDISC_REDIRECT) {
ip6_sk_redirect(skb, sk);
return;
}
if (np->recverr) {
u8 *payload = skb->data;
if (!inet->hdrincl)
Expand Down

0 comments on commit 8d65b11

Please sign in to comment.