Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2006 06:57:29 -0800
From:      Luigi Rizzo <rizzo@icir.org>
To:        Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
Cc:        FreeBSD-ipfw@freebsd.org
Subject:   Re: IPFW1->2 regression: "in/out/via any" ignored
Message-ID:  <20060323065729.C67264@xorpc.icir.org>
In-Reply-To: <20060323162418.S45142@atlantis.atlantis.dp.ua>; from dmitry@atlantis.dp.ua on Thu, Mar 23, 2006 at 04:47:17PM %2B0200
References:  <20060323133729.D63213@atlantis.atlantis.dp.ua> <20060323060006.A66681@xorpc.icir.org> <20060323162418.S45142@atlantis.atlantis.dp.ua>

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

cheers
luigi

> Sincerely, Dmitry
> -- 
> Atlantis ISP, System Administrator
> e-mail:  dmitry@atlantis.dp.ua
> nic-hdl: LYNX-RIPE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060323065729.C67264>