don't hand-roll bpf_mtap_hdr for radiotap in wireless drivers

2019-09-11 Thread David Gwynne
radiotap code puts an mbuf on the stack so it can build a chain that includes a radiotap header for bpf_mtap to chew on. bpf_mtap_hdr can do that for you though. bpf_mtap_hdr also cheats by using an m_hdr instead of a full mbuf, which makes the stack usage less, but im arguing for the diff

make tun(4) kq kevent data more like everything else

2019-09-11 Thread David Gwynne
kqueue stuff lets you provide some data when an event fires. generally things that you read and write (ie, file descriptors) provide how much data you can read or write. tun(4) provides how many packets you can read, and how many bytes you could write. im arguing that the number of packets is

Re: call if_input only once per Rx interrupt from net80211

2019-09-11 Thread Stefan Sperling
On Tue, Sep 10, 2019 at 10:35:34PM +0200, Matthias Schmidt wrote: > Hi Stefan, > > * Stefan Sperling wrote: > > > > I think I see why. I forgot to convert some existing ieee80211_input() > > calls to ieee80211_inputm(), in ieee80211_input.c. > > These calls are related to buffered aggregated

Re: let bpf_mtap_hdr take a void * instead of caddr_t for the header

2019-09-11 Thread Stefan Sperling
On Wed, Sep 11, 2019 at 10:02:24AM +1000, David Gwynne wrote: > this makes it easier to call at least. > > it also brings it in line with bpf_tap_hdr. otherwise there's no > functional change. > > ok? I don't see why not if this change helps you. I suppose you're going to be passing in a

Re: let bpf_mtap_hdr take a void * instead of caddr_t for the header

2019-09-11 Thread Alexandr Nedvedicky
On Wed, Sep 11, 2019 at 10:02:24AM +1000, David Gwynne wrote: > this makes it easier to call at least. > > it also brings it in line with bpf_tap_hdr. otherwise there's no > functional change. > > ok? OK sashan@, consistency never hurts. sashan

tcpdump fix cdp Native-VLAN-ID

2019-09-11 Thread Martijn van Duren
Found by a colleague and verified against latest tcpdump version. I don't know where the -1 comes from, but it is wrong. OK? martijn@ Index: print-cdp.c === RCS file: /cvs/src/usr.sbin/tcpdump/print-cdp.c,v retrieving revision 1.7

Re: tcpdump fix cdp Native-VLAN-ID

2019-09-11 Thread Stuart Henderson
On 2019/09/11 14:34, Martijn van Duren wrote: > Found by a colleague and verified against latest tcpdump version. > > I don't know where the -1 comes from, but it is wrong. > > OK? > > martijn@ > > Index: print-cdp.c > === > RCS

Re: let bpf_mtap_hdr take a void * instead of caddr_t for the header

2019-09-11 Thread Christian Weisgerber
David Gwynne: > this makes it easier to call at least. > > it also brings it in line with bpf_tap_hdr. otherwise there's no > functional change. And remove the casts in the two calls to bpf_mtap_hdr() a few lines further down? -- Christian "naddy" Weisgerber