db0b67
centosplus patch [bug#16521]
db0b67
db0b67
commit 8d65b1190ddc548b0411477f308d04f4595bac57
db0b67
Author: Duan Jiong <duanj.fnst@cn.fujitsu.com>
db0b67
Date:   Fri Sep 20 18:21:25 2013 +0800
db0b67
db0b67
    net: raw: do not report ICMP redirects to user space
db0b67
    
db0b67
    Redirect isn't an error condition, it should leave
db0b67
    the error handler without touching the socket.
db0b67
    
db0b67
    Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
db0b67
    Signed-off-by: David S. Miller <davem@davemloft.net>
db0b67
db0b67
    Applied-by: Akemi Yagi <toracat@centos.org>
db0b67
db0b67
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
db0b67
index bfec521..193db03 100644
db0b67
--- a/net/ipv4/raw.c
db0b67
+++ b/net/ipv4/raw.c
db0b67
@@ -218,8 +218,10 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info)
db0b67
 
db0b67
 	if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)
db0b67
 		ipv4_sk_update_pmtu(skb, sk, info);
db0b67
-	else if (type == ICMP_REDIRECT)
db0b67
+	else if (type == ICMP_REDIRECT) {
db0b67
 		ipv4_sk_redirect(skb, sk);
db0b67
+		return;
db0b67
+	}
db0b67
 
db0b67
 	/* Report error on raw socket, if:
db0b67
 	   1. User requested ip_recverr.
db0b67
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
db0b67
index 58916bb..a4ed241 100644
db0b67
--- a/net/ipv6/raw.c
db0b67
+++ b/net/ipv6/raw.c
db0b67
@@ -335,8 +335,10 @@ static void rawv6_err(struct sock *sk, struct sk_buff *skb,
db0b67
 		ip6_sk_update_pmtu(skb, sk, info);
db0b67
 		harderr = (np->pmtudisc == IPV6_PMTUDISC_DO);
db0b67
 	}
db0b67
-	if (type == NDISC_REDIRECT)
db0b67
+	if (type == NDISC_REDIRECT) {
db0b67
 		ip6_sk_redirect(skb, sk);
db0b67
+		return;
db0b67
+	}
db0b67
 	if (np->recverr) {
db0b67
 		u8 *payload = skb->data;
db0b67
 		if (!inet->hdrincl)