Subject: Re: bpf patch: bpf_mtap2
To: David Young <dyoung@pobox.com>
From: Sam Leffler <sam@errno.com>
List: tech-net
Date: 04/29/2004 19:46:38
On Apr 29, 2004, at 5:34 PM, David Young wrote:

> FreeBSD has added bpf_mtap2, which taps a packet whose head is in a 
> data
> buffer and whose tail is in an mbuf chain.  It's now used in ath(4).
> I foresee using it in several drivers.
>
> I have added bpf_mtap2 to NetBSD and refactored.  How does the attached
> code look?  Barring objections, I will commit it very soon.
>
> There are at least four uses for bpf_mtap2 in our WiFi drivers.  For
> radiotap(9) purposes, we presently fake-up an mbuf on the stack, 
> prepend
> it to an mbuf chain, and then call bpf_mtap.  bpf_mtap2 consolidates
> this function in one place.  See ath, atw, wi, maybe an.

The rationale for adding bpf_mtap2 was that it isolates all the hacky 
code that cons's up mbufs (typically on the stack) solely to pass a 
linear data buffer to bpf.

	Sam