From patchwork Mon Nov 7 15:41:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 124111 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 09DE6B6F0E for ; Tue, 8 Nov 2011 02:42:08 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932222Ab1KGPmC (ORCPT ); Mon, 7 Nov 2011 10:42:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30441 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754418Ab1KGPlu (ORCPT ); Mon, 7 Nov 2011 10:41:50 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA7FfnxX005061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Nov 2011 10:41:49 -0500 Received: from localhost ([10.3.113.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pA7FfmDg008762; Mon, 7 Nov 2011 10:41:48 -0500 From: Flavio Leitner To: netdev Cc: David Miller , Flavio Leitner Subject: [PATCH] route: fix ICMP secure_redirects Date: Mon, 7 Nov 2011 13:41:45 -0200 Message-Id: <1320680505-26367-1-git-send-email-fbl@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org It should accept ICMP redirects from any host and not just from gateways when secure_redirects is disabled. Signed-off-by: Flavio Leitner --- 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; }