I committed the bpf chunk, but nothing is using it yet. pls give the
if_vlan.c chunk a spin.

Index: net/if_vlan.c
===================================================================
RCS file: /cvs/src/sys/net/if_vlan.c,v
retrieving revision 1.106
diff -u -p -r1.106 if_vlan.c
--- net/if_vlan.c       9 Jul 2014 09:30:49 -0000       1.106
+++ net/if_vlan.c       9 Jul 2014 14:09:43 -0000
@@ -213,7 +213,7 @@ vlan_start(struct ifnet *ifp)
 
 #if NBPFILTER > 0
                if (ifp->if_bpf)
-                       bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
+                       bpf_mtap_stripvlan(ifp->if_bpf, m, BPF_DIRECTION_OUT);
 #endif
 
                /*


* Henning Brauer <hb-openbsdt...@ml.bsws.de> [2014-07-09 23:46]:
> so dlg noticed that tcpdump on vlan is now somewhat busted,
> specifically dhc* don't work on the any more. the reason is that bpf
> now sees the ether_vlan_header instead of the ether_header. only
> visible if your NIC does NOT have hw vlan tagging.
> reason: while we previously would prepend an ethernet header in
> ether_output and way later in vlan_start throw the ethernet header
> away again, replacing it by an ether_vlan_header, we now add the
> ether_vlan_header in ether_output already. the mtap is in vlan_start,
> aka after.
> now removing the ether_vlan_header and either prepending a new
> ether_header or calling bpf_mtap_ether which adds a fake one didn't
> seem too smart. so I made a bpf_mcopy_stripvlan which, well, cuts
> those extra 4 bytes out.
> 
> the if_ethersubr.c chunk eases testing, it'll make us hit the right
> codepath wether the hw has tagging or not. that chunk not to be
> committed of course.

-- 
Henning Brauer, h...@bsws.de, henn...@openbsd.org
BS Web Services GmbH, http://bsws.de, Full-Service ISP
Secure Hosting, Mail and DNS. Virtual & Dedicated Servers, Root to Fully Managed
Henning Brauer Consulting, http://henningbrauer.com/

Reply via email to