Skip to contentSkip to conversation

Add strict check for replying net unreachable message

PATCH Applied Mitsuru Chinen 2 participants 2 messages Dec 7, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add strict check for replying net unreachable message

The patch `Reply net unreachable ICMP message' had a bug. A route whose type is blockhole or prohibit type is treated as unreachable type. The case where err is set to ENETUNREACH should be that no route is found in the routing table only.

---
 net/ipv4/route.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/ipv4/route.c +2 -1
index 8a79f74..d2bc614 100644
@@ -1882,7 +1882,8 @@ no_route:
 	RT_CACHE_STAT_INC(in_no_route);
 	spec_dst = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE);
 	res.type = RTN_UNREACHABLE;
-	err = -ENETUNREACH;
+	if (err == -ESRCH)
+		err = -ENETUNREACH;
 	goto local_input;
 
 	/*
Signature · 1 line
1.5.3.4
maintainer Applied
#1 lore raw

From: Mitsuru Chinen <[email protected]>
Date: Fri, 7 Dec 2007 13:24:18 +0900

Quoted 6 lines

The patch `Reply net unreachable ICMP message' had a bug. A route whose type is blockhole or prohibit type is treated as unreachable type. The case where err is set to ENETUNREACH should be that no route is found in the routing table only.

Applied, thanks.

I'll probably combine this with your original change before I push these changes upstream.