netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: Re-routing packets via netfilter (ip_rt_bug)
@ 2005-04-26 15:39 Yair Itzhaki
  0 siblings, 0 replies; 18+ messages in thread
From: Yair Itzhaki @ 2005-04-26 15:39 UTC (permalink / raw)
  To: Herbert Xu, Patrick McHardy; +Cc: linux-kernel, netfilter-devel, netdev

I'm afraid I'm not following you.
Where did you want to set saddr=0 ?

Yair


> -----Original Message-----
> From: Herbert Xu [mailto:herbert@gondor.apana.org.au]
> Sent: Tuesday, April 26, 2005 02:39
> To: Patrick McHardy
> Cc: Yair Itzhaki; linux-kernel@vger.kernel.org; 
> netfilter-devel@lists.netfilter.org; netdev@oss.sgi.com
> Subject: Re: Re-routing packets via netfilter (ip_rt_bug)
> 
> 
> On Tue, Apr 26, 2005 at 02:08:18AM +0200, Patrick McHardy wrote:
> > Herbert Xu wrote:
> > >You're right.  But then we can't call ip_route_output in the case
> > >where saddr is foreign but daddr is local.  Nor can we call
> > >ip_route_input since the output will be ip_rt_bug.
> > 
> > In that case we need to use saddr=0, which shouldn't make 
> any difference
> > with sane routing.
> 
> Makes sense.  But what about the case where saddr is foreign but
> daddr is broadcast/multicast?
> 
> Cheers,
> -- 
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: Re-routing packets via netfilter (ip_rt_bug)
@ 2005-05-02 17:17 Yair Itzhaki
  2005-07-14 12:27 ` Ric Wheeler
  0 siblings, 1 reply; 18+ messages in thread
From: Yair Itzhaki @ 2005-05-02 17:17 UTC (permalink / raw)
  To: Patrick McHardy, Herbert Xu
  Cc: Jozsef Kadlecsik, netdev, netfilter-devel, linux-kernel

Can anyone propose a patch that I can start checking?

I have come up with the following:

--- net/core/netfilter.c.orig   2005-04-18 21:55:30.000000000 +0300
+++ net/core/netfilter.c        2005-05-02 17:35:20.000000000 +0300
@@ -622,9 +622,10 @@
        /* 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 (inet_addr_type(iph->saddr) == RTN_LOCAL) {
+       if ((inet_addr_type(iph->saddr) == RTN_LOCAL) ||
+           (inet_addr_type(iph->daddr) == RTN_LOCAL)) {
                fl.nl_u.ip4_u.daddr = iph->daddr;
-               fl.nl_u.ip4_u.saddr = iph->saddr;
+               fl.nl_u.ip4_u.saddr = 0;
                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

Please advise,
Yair


> -----Original Message-----
> From: Patrick McHardy [mailto:kaber@trash.net]
> Sent: Wednesday, April 27, 2005 14:05
> To: Herbert Xu
> Cc: Jozsef Kadlecsik; netdev@oss.sgi.com; 
> netfilter-devel@lists.netfilter.org; Yair Itzhaki; 
> linux-kernel@vger.kernel.org
> Subject: Re: Re-routing packets via netfilter (ip_rt_bug)
> 
> 
> Herbert Xu wrote:
> > Here is another reason why these packets should go through FORWARD.
> > They were generated in response to packets in INPUT/FORWARD/OUTPUT.
> > The original packet has not undergone SNAT in any of these cases.
> > 
> > However, if we feed the response packet through LOCAL_OUT it will
> > be subject to DNAT.  This creates a NAT asymmetry and we may end
> > up with the wrong destination address.
> > 
> > By pushing it through FORWARD it will only undergo SNAT which is
> > correct since the original packet would have undergone DNAT.
> 
> This is only a problem since the recent NAT changes, but I agree
> that we should fix it by moving these packets to FORWARD.
> 
> Regards
> Patrick
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-07-14 12:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <426CB342.2010504@trash.net>
2005-04-25 10:52 ` Re-routing packets via netfilter (ip_rt_bug) Herbert Xu
2005-04-25 15:28   ` Patrick McHardy
2005-04-25 21:34     ` Herbert Xu
2005-04-26  0:08       ` Patrick McHardy
2005-04-26  0:39         ` Herbert Xu
2005-04-26 13:17           ` Patrick McHardy
2005-04-26 23:28             ` Herbert Xu
2005-04-27  0:56               ` Patrick McHardy
2005-04-27  1:07                 ` Herbert Xu
2005-04-27 10:26                   ` Patrick McHardy
2005-04-27 10:30                     ` Herbert Xu
2005-04-27 10:41                       ` Jozsef Kadlecsik
2005-04-27 11:35                         ` Herbert Xu
2005-04-27 11:54                           ` Herbert Xu
2005-04-27 12:05                             ` Patrick McHardy
2005-04-26 15:39 Yair Itzhaki
  -- strict thread matches above, loose matches on Subject: below --
2005-05-02 17:17 Yair Itzhaki
2005-07-14 12:27 ` Ric Wheeler

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).