freebsd-dev/sys/net
Christian S.J. Peron 52f1277eea Currently, drivers that support hardware offload of VLAN tag
processing are forced to toggle this functionality when the card
is put in and out of promiscuous mode.  The main reason for this
is because the hardware strips the VLAN tag, making it impossible
for the tag information to show up in network diagnostic tools like
tcpdump(1).

This change introduces ether_vlan_mtap(), which is called if the
mbuf has M_VLANTAG set.  VLAN information is extracted from the
mbuf and inserted into a stack allocated ether vlan header which
is then inserted through the bpf machinery via bpf_mtap2(). The
original mbuf's data pointer and lengths are temporarily adjusted
to eliminate the original Ethernet header for the duration of the
tap operation. This should have no long term effects on the mbuf.

Also, define a new macro, ETHER_BPF_MTAP which should be used
by drivers which support hardware offload of VLAN tag processing.

The fixes for the relevant drivers will follow shortly.

Discussed with:		rwatson, andre, jhb (and others)
Much feedback from:	sam, ru
MFC after:	1 month [1]

[1] The version that is eventually MFCed will be somewhat
    different then this, as there has been significant work
    done to the VLAN code in HEAD.
2006-11-18 23:17:22 +00:00
..
bpf_compat.h
bpf_filter.c Avoid unwanted sign extension of indexed byte load in bpf code. 2006-05-28 20:00:02 +00:00
bpf_jitter.c Add BPF Just-In-Time compiler support for ng_bpf(4). 2005-12-07 21:30:47 +00:00
bpf_jitter.h Add BPF Just-In-Time compiler support for ng_bpf(4). 2005-12-07 21:30:47 +00:00
bpf.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
bpf.h more juniper dlt's 2006-09-04 19:24:34 +00:00
bpfdesc.h Fix the following bpf(4) race condition which can result in a panic: 2006-06-02 19:59:33 +00:00
bridgestp.c MFp4 2006-11-09 22:50:49 +00:00
bridgestp.h MFp4 2006-11-09 22:50:49 +00:00
bsd_comp.c Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
ethernet.h Currently, drivers that support hardware offload of VLAN tag 2006-11-18 23:17:22 +00:00
fddi.h - Make IFP2ENADDR() a pointer to IF_LLADDR() rather than another 2005-11-11 07:36:14 +00:00
firewire.h Stop embedding struct ifnet at the top of driver softcs. Instead the 2005-06-10 16:49:24 +00:00
if_arc.h Use ANSI C function protypes and declarations for if_arcsubr. 2006-04-12 07:44:31 +00:00
if_arcsubr.c Use ANSI C function protypes and declarations for if_arcsubr. 2006-04-12 07:44:31 +00:00
if_arp.h - Store pointer to the link-level address right in "struct ifnet" 2005-11-11 16:04:59 +00:00
if_atm.h Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and 2005-08-09 10:20:02 +00:00
if_atmsubr.c Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
if_bridge.c Add a new address cache type called sticky. On an interface marked sticky any 2006-11-09 06:32:38 +00:00
if_bridgevar.h Add a new address cache type called sticky. On an interface marked sticky any 2006-11-09 06:32:38 +00:00
if_clone.c Revise network interface cloning to take an optional opaque 2006-07-09 06:04:01 +00:00
if_clone.h Revise network interface cloning to take an optional opaque 2006-07-09 06:04:01 +00:00
if_disc.c Revise network interface cloning to take an optional opaque 2006-07-09 06:04:01 +00:00
if_dl.h
if_ef.c Return mbuf pointer or NULL from ip_fastforward() as the mbuf pointer 2006-01-18 14:24:39 +00:00
if_enc.c Catch up with the revised network interface cloning which takes an optional 2006-07-10 05:24:06 +00:00
if_ethersubr.c Currently, drivers that support hardware offload of VLAN tag 2006-11-18 23:17:22 +00:00
if_faith.c With exception of the if_name() macro, all definitions in net_osdep.h 2006-08-04 21:27:40 +00:00
if_fddisubr.c Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
if_fwsubr.c Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
if_gif.c Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
if_gif.h Add some initial locking to gif(4). It doesn't covers the whole driver, 2006-01-30 08:39:09 +00:00
if_gre.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
if_gre.h Stop embedding struct ifnet at the top of driver softcs. Instead the 2005-06-10 16:49:24 +00:00
if_iso88025subr.c Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
if_llc.h Add hooks into the networking layer to support if_bridge. This changes struct 2005-06-05 03:13:13 +00:00
if_loop.c fixed a bug that local IPv6 traffic (to an address configured on an 2006-09-22 01:31:22 +00:00
if_media.c - Introduce ifmedia_baudrate(), which returns correct baudrate of the 2006-02-14 12:10:03 +00:00
if_media.h - Add definition for IFM_10G_CX4. 2006-06-02 07:50:58 +00:00
if_mib.c Add a new leaf to the net.link.generic.ifdata.%d sysctl to retrieve 2006-01-04 12:57:09 +00:00
if_mib.h Add a new leaf to the net.link.generic.ifdata.%d sysctl to retrieve 2006-01-04 12:57:09 +00:00
if_ppp.c Teach an IPv6 to ppp(4). 2006-11-11 15:02:04 +00:00
if_ppp.h
if_pppvar.h Teach an IPv6 to ppp(4). 2006-11-11 15:02:04 +00:00
if_sl.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
if_slvar.h Stop embedding struct ifnet at the top of driver softcs. Instead the 2005-06-10 16:49:24 +00:00
if_sppp.h Stop embedding struct ifnet at the top of driver softcs. Instead the 2005-06-10 16:49:24 +00:00
if_spppfr.c Stop embedding struct ifnet at the top of driver softcs. Instead the 2005-06-10 16:49:24 +00:00
if_spppsubr.c Correct buffer overflow in the handling of LCP options in ppp(4) 2006-08-23 22:06:08 +00:00
if_stf.c Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
if_stf.h
if_tap.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
if_tap.h Fix our ioctl(2) implementation when the argument is "int". New 2006-09-27 19:57:02 +00:00
if_tapvar.h Stop embedding struct ifnet at the top of driver softcs. Instead the 2005-06-10 16:49:24 +00:00
if_tun.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
if_tun.h
if_types.h Add a pseudo interface for packet filtering IPSec connections before or after 2006-06-26 22:30:08 +00:00
if_var.h Improve description of if_capabilities, if_capenable and ifi_hwassist. 2006-09-06 18:06:04 +00:00
if_vlan_var.h Move ethernet VLAN tags from mtags to its own mbuf packet header field 2006-09-17 13:33:30 +00:00
if_vlan.c - Update the baudrate every time the parent changes its link state. 2006-10-11 10:06:35 +00:00
if.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
if.h First step of TSO (TCP segmentation offload) support in our network stack. 2006-09-06 21:51:59 +00:00
iso88025.h - Make IFP2ENADDR() a pointer to IF_LLADDR() rather than another 2005-11-11 07:36:14 +00:00
netisr.c - Don't pollute opt_global.h with DEVICE_POLLING and introduce 2005-10-05 10:09:17 +00:00
netisr.h
pfil.c Somewhat re-factor the read/write locking mechanism associated with the packet 2006-02-02 03:13:16 +00:00
pfil.h define lock.h before rwlock.h for DEBUG_LOCKS 2006-02-02 20:33:10 +00:00
pfkeyv2.h
ppp_comp.h
ppp_deflate.c This patch fixes a problem, which exists if you have IPSEC in your kernel 2006-02-27 16:56:22 +00:00
ppp_defs.h
ppp_tty.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
radix.c The code in rn_walktree_from() that checks if we backed up too far 2006-02-07 20:25:39 +00:00
radix.h
raw_cb.c raw_disconnect() now disconnects but does not detach the raw pcb. As a 2006-06-02 08:27:15 +00:00
raw_cb.h
raw_usrreq.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
route.c Assuming the interface has an address of x.x.x.195, a mask of 2006-06-05 21:20:21 +00:00
route.h - Fill in the correct rtm_index for RTM_ADD and RTM_CHANGE messages. 2006-03-15 19:39:09 +00:00
rtsock.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
slcompress.c
slcompress.h
slip.h
zlib.c Forward declare z_errmsg with static linkage since it is defined 2005-09-11 16:13:02 +00:00
zlib.h