Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2003 12:00:28 -0800 (PST)
From:      wpaul@FreeBSD.ORG (Bill Paul)
To:        julian@elischer.org (Julian Elischer)
Cc:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netgraph ng_fec.c
Message-ID:  <20030226200028.2584D37B401@hub.freebsd.org>
In-Reply-To: <Pine.BSF.4.21.0302252331450.78515-100000@InterJet.elischer.org> from Julian Elischer at "Feb 25, 2003 11:41:02 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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




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