Subject: Re: bpf patch: bpf_mtap2
To: None <tech-net@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: tech-net
Date: 05/05/2004 19:15:42
On Wed, May 05, 2004 at 03:35:55AM +0000, Darren Reed wrote:
> On Tue, May 04, 2004 at 08:46:59PM -0500, David Young wrote:
> > Here is another bpf_mtap2 patch. Also, I have patched if_tun.c to use
> > bpf_mtap2, following a suggestion by Darren.
>
> Hmmm, in bpf_mtap2(), is it worth setting the M_PKTHDR flag ?
> e.g.
>
> mb.m_flags = M_PKTHDR;
> mb.m_len = pktlen;
>
> rather than just:
> mb.m_len = dlen;
I think you mean
mb.m_flags = M_PKTHDR;
mb.m_pkthdr.len = pktlen;
Since bpf is just going to iterate over the chain, anyway, I don't think
it matters too much.
> ...or are there other fields that need to be intact if M_PKTHDR is defined ?
No idea. See Darren Reed's remarks re: the complexity of mbuf. Oh,
wait:
> Darren
:-)
Dave
--
David Young OJC Technologies
dyoung@ojctech.com Urbana, IL * (217) 278-3933