netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
	Rami Rosen <roszenrami@gmail.com>,
	Jarek Poplawski <jarkao2@gmail.com>
Subject: [PATCH] [IPv4] Add strict check for replying net unreachable message
Date: Fri, 7 Dec 2007 13:24:18 +0900	[thread overview]
Message-ID: <20071207132418.d19d2f0e.mitch@linux.vnet.ibm.com> (raw)

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.

Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
---
 net/ipv4/route.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 8a79f74..d2bc614 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -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;
 
 	/*
-- 
1.5.3.4


             reply	other threads:[~2007-12-07  4:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-07  4:24 Mitsuru Chinen [this message]
2007-12-07  6:41 ` [PATCH] [IPv4] Add strict check for replying net unreachable message David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071207132418.d19d2f0e.mitch@linux.vnet.ibm.com \
    --to=mitch@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=jarkao2@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=roszenrami@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).