From owner-cvs-all Wed Feb 26 12: 5:26 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C506B37B413; Wed, 26 Feb 2003 12:05:19 -0800 (PST) Received: from sccrmhc03.attbi.com (sccrmhc03.attbi.com [204.127.202.63]) by mx1.FreeBSD.org (Postfix) with ESMTP id C245343FDD; Wed, 26 Feb 2003 12:05:18 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc03.attbi.com (sccrmhc03) with ESMTP id <20030226200517003007g102e>; Wed, 26 Feb 2003 20:05:17 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA98084; Wed, 26 Feb 2003 12:05:16 -0800 (PST) Date: Wed, 26 Feb 2003 12:05:15 -0800 (PST) From: Julian Elischer To: Bill Paul Cc: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netgraph ng_fec.c In-Reply-To: <20030226200028.2584D37B401@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 26 Feb 2003, Bill Paul wrote: > > > > On Tue, 25 Feb 2003, Bill Paul wrote: > > > > > wpaul 2003/02/25 22:38:54 PST > > > > > > Modified files: > > > sys/netgraph ng_fec.c > > > Log: > > > Attempt to make the ng_fec module play nice with BPF again. Things have > > > changed since this code was written: > > > > > > - The ng_ether_input_p hook only accepts two arguments now: the pointer > > > to the ether header structure is gone. > > > > The problem is that you should not be using ng_ether_input_p at all > > that is a private interface between ng_ether.c and if_ethersubr.c. > > You should be connecting a hook to ng_ether.c which will in turn > > use ng_ether_input_p. > > [...] > > Actually, there's a better (IMO) way. When I originally wrote this module, > I ended up using some netgraph features for two reasons: 1) using ngctl > saved me from having to write a separate feccontrol utility or mangling > ifconfig(8) to handle bundle configuration, and 2) I needed a way to snag > incoming frames. The ng_ether_input_p hook let me do that without having > to modify if_ethersubr.c myself, which I wanted to avoid. What I _really_ > wanted to do was grab packets from the interfaces directly, before they > went into ether_input(), but I couldn't do that then. > > I can, however, do it now. In 5.x, drivers call ifp->if_input rather than > using ether_input() directly, which makes it very simple to snarf frames > from them and massage them a bit before passing them on. I decided to > change ng_fec to work this way. As far as I'm concerned, it's a much > cleaner solution, and it avoids the collison with ng_ether. Great.. This makes ng_fec.c a netgraph node in name only.. :-) it just uses the netgraph infrastructure for control messages and for module loadabilty. > > -Bill > > -- > ============================================================================= > -Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu > wpaul@windriver.com | Wind River Systems > ============================================================================= > "If stupidity were a handicap, you'd have the best parking spot." > ============================================================================= > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message