[IPv4]: Reply net unreachable ICMP message

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, December 7, 2007 - 3:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f5387...
Commit:     7f53878dc2618bf7c01e2135bd271ac01bd85dc9
Parent:     ca46f9c834913fc5d5c196d70673375cdaba6b56
Author:     Mitsuru Chinen <mitch@linux.vnet.ibm.com>
AuthorDate: Fri Dec 7 01:07:24 2007 -0800
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Fri Dec 7 01:07:24 2007 -0800

    [IPv4]: Reply net unreachable ICMP message
    
    IPv4 stack doesn't reply any ICMP destination unreachable message
    with net unreachable code when IP detagrams are being discarded
    because of no route could be found in the forwarding path.
    Incidentally, IPv6 stack replies such ICMPv6 message in the similar
    situation.
    
    Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv4/route.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c426dec..79c4b93 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1252,6 +1252,7 @@ static int ip_error(struct sk_buff *skb)
 			break;
 		case ENETUNREACH:
 			code = ICMP_NET_UNREACH;
+			IP_INC_STATS_BH(IPSTATS_MIB_INNOROUTES);
 			break;
 		case EACCES:
 			code = ICMP_PKT_FILTERED;
@@ -1881,6 +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;
+	if (err == -ESRCH)
+		err = -ENETUNREACH;
 	goto local_input;
 
 	/*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[IPv4]: Reply net unreachable ICMP message, Linux Kernel Mailing List..., (Fri Dec 7, 3:59 pm)