Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946252AbXBCCg3 (ORCPT ); Fri, 2 Feb 2007 21:36:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1946243AbXBCCg1 (ORCPT ); Fri, 2 Feb 2007 21:36:27 -0500 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:52676 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946241AbXBCCfs (ORCPT ); Fri, 2 Feb 2007 21:35:48 -0500 Message-Id: <20070203023823.065839000@sous-sol.org> References: <20070203023504.435051000@sous-sol.org> User-Agent: quilt/0.45-1 Date: Fri, 02 Feb 2007 18:35:10 -0800 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Patrick McHardy , netfilter-devel@lists.netfilter.org, davem@davemloft.net Subject: [patch 06/59] NETFILTER: Fix routing of REJECT target generated packets in output chain Content-Disposition: inline; filename=netfilter-fix-routing-of-reject-target-generated-packets-in-output-chain.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1597 Lines: 46 -stable review patch. If anyone has any objections, please let us know. ------------------ From: Patrick McHardy Packets generated by the REJECT target in the output chain have a local destination address and a foreign source address. Make sure not to use the foreign source address for the output route lookup. Signed-off-by: Patrick McHardy Signed-off-by: Chris Wright --- net/ipv4/netfilter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- linux-2.6.19.2.orig/net/ipv4/netfilter.c +++ linux-2.6.19.2/net/ipv4/netfilter.c @@ -15,16 +15,19 @@ int ip_route_me_harder(struct sk_buff ** struct flowi fl = {}; struct dst_entry *odst; unsigned int hh_len; + unsigned int type; + type = inet_addr_type(iph->saddr); if (addr_type == RTN_UNSPEC) - addr_type = inet_addr_type(iph->saddr); + addr_type = type; /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause * packets with foreign saddr to appear on the NF_IP_LOCAL_OUT hook. */ if (addr_type == RTN_LOCAL) { fl.nl_u.ip4_u.daddr = iph->daddr; - fl.nl_u.ip4_u.saddr = iph->saddr; + if (type == RTN_LOCAL) + fl.nl_u.ip4_u.saddr = iph->saddr; fl.nl_u.ip4_u.tos = RT_TOS(iph->tos); fl.oif = (*pskb)->sk ? (*pskb)->sk->sk_bound_dev_if : 0; #ifdef CONFIG_IP_ROUTE_FWMARK -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/