From owner-cvs-all@FreeBSD.ORG Sat Nov 18 23:17:23 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86AAE16A403; Sat, 18 Nov 2006 23:17:23 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E12343D49; Sat, 18 Nov 2006 23:17:17 +0000 (GMT) (envelope-from csjp@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kAINHMtT010432; Sat, 18 Nov 2006 23:17:22 GMT (envelope-from csjp@repoman.freebsd.org) Received: (from csjp@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kAINHMLB010431; Sat, 18 Nov 2006 23:17:22 GMT (envelope-from csjp) Message-Id: <200611182317.kAINHMLB010431@repoman.freebsd.org> From: "Christian S.J. Peron" Date: Sat, 18 Nov 2006 23:17:22 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/net ethernet.h if_ethersubr.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Nov 2006 23:17:23 -0000 csjp 2006-11-18 23:17:22 UTC FreeBSD src repository Modified files: sys/net ethernet.h if_ethersubr.c Log: 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. Revision Changes Path 1.26 +19 -0 src/sys/net/ethernet.h 1.220 +40 -0 src/sys/net/if_ethersubr.c