All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: xt_gateway 20070605 (kernel)
@ 2007-06-15 17:20 Amin Azez
  2007-06-15 17:27 ` Patrick McHardy
  0 siblings, 1 reply; 20+ messages in thread
From: Amin Azez @ 2007-06-15 17:20 UTC (permalink / raw)
  To: Patrick McHardy, Jan Engelhardt
  Cc: Netfilter Developer Mailing List, Amin Azez

I agree that pointless checks are not needed at runtime.

I am not sure what other changes I should make to stop people crashing the kernel by using this match in places I have not forseen.

I am not certain that my anticpated crashes are actually possible.

Patrick, If I merely remove these unnecessary tests, will you be satisfied with the result?

Sam

-----Original Message-----
From: "Patrick McHardy" <kaber@trash.net>
To: "Jan Engelhardt" <jengelh@computergmbh.de>
Cc: "Amin Azez" <azez@ufomechanic.net>; "Netfilter Developer Mailing List" <netfilter-devel@lists.netfilter.org>
Sent: 15/06/07 17:15
Subject: Re: xt_gateway 20070605 (kernel)

Jan Engelhardt wrote:
> On Jun 15 2007 12:30, Amin Azez wrote:
> 
>>>and the neighbour table family is always AF_INET since the
>>>match is only registered for AF_INET.
>>>  
>>
>>Maybe if I take out these checks, I should restrict the match to FORWARD
>>and POSTROUTING?
> 
> 
> Leaving them in does not cost too much.


Thats no reason to keep pointless checks around.

^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: xt_gateway 20070605 (kernel)
@ 2007-06-16  9:29 Amin Azez
  2007-06-16 12:00 ` Jan Engelhardt
  0 siblings, 1 reply; 20+ messages in thread
From: Amin Azez @ 2007-06-16  9:29 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Netfilter Developer Mailing List, Patrick McHardy


From: "Jan Engelhardt" <jengelh@computergmbh.de>
Sent: 16/06/07 08:59
Subject: RE: xt_gateway 20070605 (kernel)

=Well, it is as complicated as policy routing
=(e.g. using -j MARK and iproute2's fwmark match)
=
=ip route add 1.3.3.7/32 dev leet0 realm 666
=iptables -t nat -A POSTROUTING -m realm --realm 666 -j 
=SNAT --to whatever.

Yeah, you have to have one realm per snat-ip or better, which is more complicated than just using the gateway ip.

It's true that you can use realm to make an association between gateway and snat address, but why bother if you can use gateway to make an association between gateway and snat address.

To use realm requires fiddling with routing tables (which I can do pleasantly as iproute-save supports xml) but gateway match lets users leave routing to be managed by their network scripts instead of managing it by hand. 

=>Xt_gateway is persisted solely with iptables-save. There is no iproute-save
=>(actually there is, I posted it to the relevant list a few months back but
=>no-one noticed).

=iproute-save would have a problem: it may interfere with
= (a) 'proto kernel' rules

My iproute-restore did not restore proto kernel routes, or flush them prior to a restore.

= (b) rules from the distribution (e.g. =/etc/sysconfig/network/ifroutes)
=    [lesser a problem]

Likewise, scope helped recognize these.

=>I'm not going to try to convince you harder than this. Some directors and
=>shareholders (if they were aware) would probably prefer that you did NOT merge
=>it to the mainline kernel and I also have a duty to them.

=What would they care about how it's done?

They might prefer that anything that made things easier were not available outside of the source CD that we ship with the box. There is no official company policy on this yet, and I prefer it that way.

The gateway match makes things easier for me. All our customers will be using it. I'm happy to share it.

If Patrick judges it to be unneccessary then I don't feel very inclined to argue the point. I agree that authors cannot insist that their contributions be recommended upstream and linux is not so scarce of features that this is remotely necessary.

Like my iptables vlan match and conntrack direction match, account + rate limiting, and probably the same way as my next connroute target all of which are useful to me, I'm disapointed that they won't have wider use, but not frantic.

Sam

^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: xt_gateway 20070605 (kernel)
@ 2007-06-16  7:34 Amin Azez
  2007-06-16  7:59 ` Jan Engelhardt
  0 siblings, 1 reply; 20+ messages in thread
From: Amin Azez @ 2007-06-16  7:34 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Jan Engelhardt, Netfilter Developer Mailing List

From: "Patrick McHardy" <kaber@trash.net>
Sent: 15/06/07 18:27
Subject: Re: xt_gateway 20070605 (kernel)

=So far I don't intend to merge it, but I'm also not very opposed
=to it (only reason against it is that its another file to take
=care of when changing say function signatures and it doesn't
=offer anything that we can't already do). Its up to you to
convince me :)

It does one thing well and simply.
For most iptables users, realms is more complicated than replicating route information in the nat table.

Realms are perhaps suitable with a large routing infrastructure under one administration.

Xt_gateway removes the need for the more advanced explanations of the SNAT target that are required from time to time.

Xt_gateway is simple to manage snat when the gateways are out of administrative control.

Xt_gateway is persisted solely with iptables-save.
There is no iproute-save (actually there is, I posted it to the relevant list a few months back but no-one noticed).

I'm not going to try to convince you harder than this. Some directors and shareholders (if they were aware) would probably prefer that you did NOT merge it to the mainline kernel and I also have a duty to them.

However I thank you (and more particularly Jan) for the time you have spent on this.

Sam

^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: xt_gateway 20070605 (kernel)
@ 2007-06-06 15:58 Amin Azez
  2007-06-06 16:06 ` Patrick McHardy
  0 siblings, 1 reply; 20+ messages in thread
From: Amin Azez @ 2007-06-06 15:58 UTC (permalink / raw)
  To: Patrick McHardy, Jan Engelhardt
  Cc: Netfilter Developer Mailing List, Amin Azez

So is it necessary to resubmit the kernel patch with the un-necessary matches turned into explanatory comments?

Sam

-----Original Message-----
From: "Patrick McHardy" <kaber@trash.net>
To: "Jan Engelhardt" <jengelh@linux01.gwdg.de>
Cc: "Netfilter Developer Mailing List" <netfilter-devel@lists.netfilter.org>; "Amin Azez" <azez@ufomechanic.net>
Sent: 06/06/07 12:31
Subject: Re: xt_gateway 20070605 (kernel)

Jan Engelhardt wrote:
> On Jun 5 2007 17:15, Patrick McHardy wrote:
> 
>>Most of the checks here are unnecessary anyway (we always
>>have a skb with skb->dst != NULL, neigh->tbl is always != NULL
>>and the neighbour table family is always AF_INET since the
>>match is only registered for AF_INET.
> 
> 
> Thanks for letting us now. Now, prime question: Is skb always != NULL?
> (Otherwise it would not really make sense calling the match if
> there was nothing to match.)


Yes.

^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: xt_gateway 20070605 (kernel)
@ 2007-06-06  7:01 Amin Azez
  0 siblings, 0 replies; 20+ messages in thread
From: Amin Azez @ 2007-06-06  7:01 UTC (permalink / raw)
  To: Phil Oester, Jan Engelhardt; +Cc: Netfilter Developer Mailing List, Amin Azez

I apologise again for top-posting and all the sins of pocket outlook quoting.

As best as I can recall without the source in front of me a route cache item attached to the skb on routing is cast to a neighbour table entry. (they are the same waist up). 

There is no way at forward or postrouting time to tell if the skb's attached neighbour table member is (was once) a route cache entry or just a plain neighbour table entry.

This means it is not safe (hard to know when it is safe) to cast it back to a route cache item to match what you need.

Perhaps yours is a case to use realm match as Patrick has mentioned.

What you want requires a change to the routing code so that it leaves evidence that the next hop is a route entry.

BTW the ROUTE target doesn't route so much as transmit. I hope to alter it so that in PREROUTING (or later) it actually adds a route to the skb, so that postrouting will work.

Sam

-----Original Message-----
From: "Phil Oester" <kernel@linuxace.com>
To: "Jan Engelhardt" <jengelh@linux01.gwdg.de>
Cc: "Amin Azez" <azez@ufomechanic.net>; "Netfilter Developer Mailing List" <netfilter-devel@lists.netfilter.org>
Sent: 05/06/07 23:24
Subject: Re: xt_gateway 20070605 (kernel)

On Tue, Jun 05, 2007 at 01:17:57PM +0200, Jan Engelhardt wrote:
> 
> Originally from Amin Azez <azez@ufomechanic.net>,
> http://lists.netfilter.org/pipermail/netfilter-devel/2007-June/027954.html
> 
> This adds a gateway match to iptables that lets you match against the
> routed ipv4 gateway, it's very useful for SNAT if you want to avoid
> replicating your routing in your SNAT table.

Just a suggestion...for a while I've been needing the ability to match
on the routing table (but not just the gateway).  Could we perhaps name
this match 'route' instead (similar to the ROUTE target)?

Some of the things I'd like to be able to do is match on the length
of a route.  For instance we use lots of 10.x.x.x/30 nets internally
and I'd like to be able to match on them.  I haven't quite gotten around
to figuring out how to do this given the route cache doesn't include
prefix length, but I do think it would be useful.  I could see how
it could be combined with this gateway match.

Thoughts?

Phil

^ permalink raw reply	[flat|nested] 20+ messages in thread
* xt_gateway 20070605
@ 2007-06-05 11:17 Jan Engelhardt
  2007-06-05 11:17 ` xt_gateway 20070605 (kernel) Jan Engelhardt
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Engelhardt @ 2007-06-05 11:17 UTC (permalink / raw)
  To: Amin Azez; +Cc: Netfilter Developer Mailing List

Hi!


xt_gateway, with the (hopefully) fixed condition logic.


Thanks,
	Jan
-- 

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

end of thread, other threads:[~2007-06-16 16:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-15 17:20 xt_gateway 20070605 (kernel) Amin Azez
2007-06-15 17:27 ` Patrick McHardy
2007-06-15 19:21   ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2007-06-16  9:29 Amin Azez
2007-06-16 12:00 ` Jan Engelhardt
2007-06-16 12:14   ` Amin Azex
2007-06-16 16:31     ` Amin Azex
2007-06-16  7:34 Amin Azez
2007-06-16  7:59 ` Jan Engelhardt
2007-06-06 15:58 Amin Azez
2007-06-06 16:06 ` Patrick McHardy
2007-06-06  7:01 Amin Azez
2007-06-05 11:17 xt_gateway 20070605 Jan Engelhardt
2007-06-05 11:17 ` xt_gateway 20070605 (kernel) Jan Engelhardt
2007-06-05 12:08   ` Jan Engelhardt
2007-06-05 15:15     ` Patrick McHardy
2007-06-05 15:20       ` Jan Engelhardt
2007-06-06 11:31         ` Patrick McHardy
     [not found]       ` <46727873.20503@ufomechanic.net>
2007-06-15 16:11         ` Jan Engelhardt
2007-06-15 16:15           ` Patrick McHardy
2007-06-05 22:24   ` Phil Oester

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.