From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 2 00:40:22 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4735616A415 for ; Thu, 2 Nov 2006 00:40:22 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5B0F43D53 for ; Thu, 2 Nov 2006 00:40:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kA20eLSj068342 for ; Thu, 2 Nov 2006 00:40:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kA20eLeW068341; Thu, 2 Nov 2006 00:40:21 GMT (envelope-from gnats) Resent-Date: Thu, 2 Nov 2006 00:40:21 GMT Resent-Message-Id: <200611020040.kA20eLeW068341@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ian Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C19AB16A49E for ; Thu, 2 Nov 2006 00:35:20 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFBEB43D64 for ; Thu, 2 Nov 2006 00:35:06 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kA20Z6s9056585 for ; Thu, 2 Nov 2006 00:35:06 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id kA20Z6Ii056584; Thu, 2 Nov 2006 00:35:06 GMT (envelope-from nobody) Message-Id: <200611020035.kA20Z6Ii056584@www.freebsd.org> Date: Thu, 2 Nov 2006 00:35:06 GMT From: Ian To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: kern/105054: vge driver sends VLAN IDs in wrong endian. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Nov 2006 00:40:22 -0000 >Number: 105054 >Category: kern >Synopsis: vge driver sends VLAN IDs in wrong endian. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 02 00:40:21 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Ian >Release: 6.2-PRERELEASE >Organization: none >Environment: FreeBSD pillbox 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Wed Nov 1 15:48:21 CST 2006 root@abomination:/usr/obj/usr/src/sys/MINIMAL i386 >Description: The Via Gigabit Ethernet driver, vge(4), sends VLAN IDs (VID) in the incorrect endian. This not only causes frames to be tagged with the wrong VID, but causes the VID field to bleed into the other fields in the 802.1Q header (Priority and CFI bits). This does _not_ affect incoming VIDs, which are handled correctly. >How-To-Repeat: Ensure the vge driver is compiled into your kernel, and that you have a vge card. Create a VLAN using ifconfig, and give it an IP address (e.g. `ifconfig vlan291 create inet 10.0.0.1/8 vlan 291 vlandev vge0`). Connect the interface to another ethernet card via a crossover cable, and sniff traffic, making sure you capture the 802.1Q header (which should appear as 0x0123 in NBO [big endian], assuming you're using vlan 291 with frame with a priority of 0 and the CFI bit unset). Attempt to ping another IP address on the VLAN's subnet (e.g. `ping 10.0.0.2`), which should generate ARP traffic on the interface. The 802.1Q header should come through as 0x2301 (little endian, due to the bug). >Fix: Patch information for /usr/src/sys/dev/vge/if_vge.c version: $FreeBSD: src/sys/dev/vge/if_vge.c,v 1.14.2.8 2006/09/05 07:06:15 mr Exp $ *** 1819,1825 **** mtag = VLAN_OUTPUT_TAG(sc->vge_ifp, m_head); if (mtag != NULL) sc->vge_ldata.vge_tx_list[idx].vge_ctl |= ! htole32(htons(VLAN_TAG_VALUE(mtag)) | VGE_TDCTL_VTAG); sc->vge_ldata.vge_tx_list[idx].vge_sts |= htole32(VGE_TDSTS_OWN); --- 1819,1825 ---- mtag = VLAN_OUTPUT_TAG(sc->vge_ifp, m_head); if (mtag != NULL) sc->vge_ldata.vge_tx_list[idx].vge_ctl |= ! htole32(htole16(VLAN_TAG_VALUE(mtag)) | VGE_TDCTL_VTAG); sc->vge_ldata.vge_tx_list[idx].vge_sts |= htole32(VGE_TDSTS_OWN); >Release-Note: >Audit-Trail: >Unformatted: