netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Flavio Leitner <fbl@redhat.com>
To: netdev <netdev@vger.kernel.org>
Cc: David Miller <davem@davemloft.net>, Flavio Leitner <fbl@redhat.com>
Subject: [PATCH] route: fix ICMP secure_redirects
Date: Mon,  7 Nov 2011 13:41:45 -0200	[thread overview]
Message-ID: <1320680505-26367-1-git-send-email-fbl@redhat.com> (raw)

It should accept ICMP redirects from any host and not
just from gateways when secure_redirects is disabled.

Signed-off-by: Flavio Leitner <fbl@redhat.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 155138d..dd6937ec 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1347,7 +1347,8 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
 				continue;
 
 			if (rt->dst.error || rt->dst.dev != dev ||
-			    rt->rt_gateway != old_gw) {
+			    (IN_DEV_SEC_REDIRECTS(in_dev) &&
+			    rt->rt_gateway != old_gw)) {
 				ip_rt_put(rt);
 				continue;
 			}
-- 
1.7.6

             reply	other threads:[~2011-11-07 15:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 15:41 Flavio Leitner [this message]
2011-11-07 18:35 ` [PATCH] route: fix ICMP secure_redirects David Miller
2011-11-07 19:05   ` Flavio Leitner
2011-11-08  0:03     ` [PATCH] route: add more relaxed option for secure_redirects Flavio Leitner
2011-11-12  1:33       ` David Miller
2011-11-16 20:46         ` Flavio Leitner
2011-11-16 22:02           ` David Miller
2011-11-16 23:17             ` Flavio Leitner
2011-11-17  1:40               ` Flavio Leitner
2011-11-17  1:41                 ` David Miller
2011-11-17 21:53                 ` 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=1320680505-26367-1-git-send-email-fbl@redhat.com \
    --to=fbl@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).