Skip to contentSkip to conversation

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

PATCH Applied Duan Jiong 2 participants 2 messages Sep 20, 2013 – Sep 24, 2013

Subsystems (3)
lore
Share & tools
lore

Duan Jiong

author
#0 lore raw

PATCH 1/1 net: udp: do not report ICMP redirects to user space

From: Duan Jiong <[email protected]>

Redirect isn't an error condition, it should leave the error handler without touching the socket.

---
 net/ipv4/udp.c | 2 +-
 net/ipv6/udp.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
net/ipv4/udp.c +1 -1
index 74d2c95..0ca44df 100644
@@ -658,7 +658,7 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
 		break;
 	case ICMP_REDIRECT:
 		ipv4_sk_redirect(skb, sk);
-		break;
+		goto out;
 	}
 
 	/*
net/ipv6/udp.c +3 -1
index f405815..72b7eaa 100644
@@ -525,8 +525,10 @@ void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 
 	if (type == ICMPV6_PKT_TOOBIG)
 		ip6_sk_update_pmtu(skb, sk, info);
-	if (type == NDISC_REDIRECT)
+	if (type == NDISC_REDIRECT) {
 		ip6_sk_redirect(skb, sk);
+		goto out;
+	}
 
 	np = inet6_sk(sk);
 
Signature · 1 line
1.8.3.1