From owner-freebsd-net@FreeBSD.ORG Fri Nov 3 01:52:21 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3945F16A494 for ; Fri, 3 Nov 2006 01:52:21 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from heff.fud.org.nz (203-109-251-39.static.bliink.ihug.co.nz [203.109.251.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id D046C43D60 for ; Fri, 3 Nov 2006 01:52:17 +0000 (GMT) (envelope-from thompsa@freebsd.org) Received: by heff.fud.org.nz (Postfix, from userid 1001) id E1C281CC29; Fri, 3 Nov 2006 14:52:15 +1300 (NZDT) Date: Fri, 3 Nov 2006 14:52:15 +1300 From: Andrew Thompson To: Kevin Sanders Message-ID: <20061103015215.GA31234@heff.fud.org.nz> References: <375baf50611021745m6d097245y4670d5741ffbd64a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <375baf50611021745m6d097245y4670d5741ffbd64a@mail.gmail.com> User-Agent: Mutt/1.5.11 Cc: net@freebsd.org Subject: Re: pfil on bridge interface, looking for ether_header X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2006 01:52:21 -0000 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