From owner-freebsd-net@FreeBSD.ORG Mon Dec 29 07:10:41 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25D7F106564A for ; Mon, 29 Dec 2008 07:10:41 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id C45F58FC12 for ; Mon, 29 Dec 2008 07:10:40 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender; b=P8aLzPMxPv+UjuSagEmZ8rdz5msOdpHcb0Rkl0YyRSJefdpFw/CaTda0I/1DHO5DvKIcvZ+R/Gd49Cc04ujtoJl+6gSTGdwfBqK9Bavb3r9efh+fAumjQrQTX7rLTlba8ojtUr5wL+EfLkKR+mg561JjihhrIivTR1WTK4tb5z4=; Received: from phoenix.codelabs.ru (ppp85-141-64-79.pppoe.mtu-net.ru [85.141.64.79]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1LHCGs-0002Cs-BQ; Mon, 29 Dec 2008 10:10:39 +0300 Date: Mon, 29 Dec 2008 10:10:37 +0300 From: Eygene Ryabinkin To: Gerry Weaver Message-ID: References: <20081229015957.4fe4d0ac@mail01.compvia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081229015957.4fe4d0ac@mail01.compvia.com> Sender: rea-fbsd@codelabs.ru Cc: freebsd-net@freebsd.org Subject: Re: pfil + if_bridge hooks not being called X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rea-fbsd@codelabs.ru List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2008 07:10:41 -0000 Gerry, good day. Sun, Dec 28, 2008 at 07:59:57PM -0600, Gerry Weaver wrote: > I am working on a driver to collect some network statistics using > pfil. I have set up a bridge and set net.link.bridge.pfil_member=1 via > sysctl. I have added hooks for incoming and outgoing packets. I also > put a third adapter into the system for dev/managment purposes. My > hooks are only being called for outgoing packets on the management > (non bridge) interface. A simple check will be to fire up standard hooks (for example, pf firewall + some rules with 'log' keyword, see 'man pf.conf') and watch for the logged packets on a pflog0 interface using tcpdump. If you'll see the packets you wanted to see, then the problem is probably with your code. If not, then probably your setup is incorrect and/or system has a bug. > I have been searching for information about > what I may have overlooked, but I can't find anything concrete. Is > there something else that I need to do to see packets on the bridge > member interfaces and incoming packets in general? You may want to add some diagnostics to the bridge_pfil() in /sys/net/if_bridge.c, rebuild your kernel and try to see how it goes. -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ #