From owner-cvs-all Wed Feb 26 12: 0:32 2003 Delivered-To: cvs-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 618) id 2584D37B401; Wed, 26 Feb 2003 12:00:28 -0800 (PST) Subject: Re: cvs commit: src/sys/netgraph ng_fec.c In-Reply-To: from Julian Elischer at "Feb 25, 2003 11:41:02 pm" To: julian@elischer.org (Julian Elischer) Date: Wed, 26 Feb 2003 12:00:28 -0800 (PST) Cc: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20030226200028.2584D37B401@hub.freebsd.org> From: wpaul@FreeBSD.ORG (Bill Paul) 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 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. -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