Re: Generic IP Firewalling Chains 1.2

Paul Rusty Russell (
Tue, 20 Jan 1998 23:38:48 +1100

In message <> you write:
> > Just released v1.2, with a patch against 2.1.80-pre4. You
> > know, the cool IPV4 firewalling replacement...
> Ok. I'll consider merging it soon. However I have a request that stems
> from Alexey's one man cisco obsolesence project. Is there a sane way to
> add
> ip_chain_scope(u32 src_ip, u32 dst_ip, u16 src_port, u16 dst_port, u8 p
> To tell me if I can cache the result of that firewall rule for
> any port
> match src port
> match dst port
> match protocol
> so that the per network card caches can handle firewalling when doing
> fast forwarding. (Note sometimes being over cautious is fine - we could
> also simply make it a "hint" field provided by the user application)

It's icky, because of the packet and byte counters on each rule.

Since my firewall chains allow more than one rule to match
(ie. accounting rules) you can't simply cache the final policy unless
it was the default and no rules were matched. This is not likely to
be the common case.

If we're allowed to play fast and loose with the counters, then this
is very possible.

I'll play with it and try to figure out what the best implementation
of ip_chain_scope is (I'm assuming it returns a bitset like

or -1 if you're not allowed to cache...).

I'll try to throw it together by the weekend.

 .sig lost in the mail.