Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Nov 2006 14:52:15 +1300
From:      Andrew Thompson <thompsa@freebsd.org>
To:        Kevin Sanders <newroswell@gmail.com>
Cc:        net@freebsd.org
Subject:   Re: pfil on bridge interface, looking for ether_header
Message-ID:  <20061103015215.GA31234@heff.fud.org.nz>
In-Reply-To: <375baf50611021745m6d097245y4670d5741ffbd64a@mail.gmail.com>
References:  <375baf50611021745m6d097245y4670d5741ffbd64a@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 02, 2006 at 05:45:50PM -0800, Kevin Sanders wrote:
> I've written a kernel module that has pfil_add_hook'ed into the pfil
> framework.  When my input packet filter function is called, I can
> mtod(*m, struct IP *) to the IP header, but haven't found a way to
> find the original ethernet header.  (*m)->m_pkthdr.header always seems
> to be NULL (I'm not even sure what it's used for but I gave it try).
> Any advice sure would be welcome, thanks in advance.

If you look in if_bridge.c:bridge_pfil you will see that the ethernet
header is stripped from the mbuf before passing to pfil. You may want to
create another hook such as ether_pfil_hook and modify the bridge to use
it. Alternatively see the recent discussion between Julian and Andre on
the matter.


cheers,
Andrew



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