Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2006 06:57:29 -0800
From:      Luigi Rizzo <>
To:        Dmitry Pryanishnikov <>
Subject:   Re: IPFW1->2 regression: "in/out/via any" ignored
Message-ID:  <>
In-Reply-To: <>; from on Thu, Mar 23, 2006 at 04:47:17PM +0200
References:  <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thu, Mar 23, 2006 at 04:47:17PM +0200, Dmitry Pryanishnikov wrote:
> > For locally generated packets i admit 'recv any' may be of some use,
> > and this is unsupported. There are probably workaround such as 'src-ip me'
>   Oops! How can one know that feature which is documented from the beginning,
> which worked in ipfw1 - became 'unsupported' in ipfw2? It's clearly a 
> regression to me, given that I can't use ipfw1 with modern RELENGs.

it's a bug, never seen one before ? :)

> > which may be of some help here although this particular instruction
> > can be expensive as it has to scan the list of local addresses.
>   I don't understand that part. Given that 'out recv ifx' still works, we have
> incoming interface name for every transit outgoing packet. I'm sure there is
> some indication in this field that clearly says: "packet _is_ 
> locally-generated". Isn't it?

yes, i am just saying that there is no code in the kernel and
in the userland compiler that interprets that info correctly.
I repeat - it's a bug. I'ts probably trivial to fix, but at the
moment i don't have the time to work on it.

If you want, the places to touch are:
sbin/ipfw/ipfw2.c the two places which parse TOK_RECV and O_RECV,
should be enabled to deal with  'any' as an interface name and encode
it somewhere in the instruction (see function fill_iface(), at the
moment 'any' is interpreted as NULL, it could become some magic
value e.g. 0x1 or the like)
sys/netinet/ip_fw2.c in function iface_match(), you should check
whether this magic value is present in the instruction and then
return 0 or 1 depending on whether or not the 'ifp' argument is non-null.

and this should be all you need to do (testing, of course :)


> Sincerely, Dmitry
> -- 
> Atlantis ISP, System Administrator
> e-mail:
> nic-hdl: LYNX-RIPE

Want to link to this message? Use this URL: <>