From owner-freebsd-net@FreeBSD.ORG Tue May 3 07:34:56 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D51BB16A4CE; Tue, 3 May 2005 07:34:56 +0000 (GMT) Received: from ford.blinkenlights.nl (ford.blinkenlights.nl [213.204.211.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6133A43D2F; Tue, 3 May 2005 07:34:56 +0000 (GMT) (envelope-from sten@blinkenlights.nl) Received: from tea.blinkenlights.nl (tea.blinkenlights.nl [IPv6:2001:960:301:3:a00:20ff:fe85:fa39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ford.blinkenlights.nl (Postfix) with ESMTP id 2BF653F294; Tue, 3 May 2005 09:34:55 +0200 (CEST) Received: by tea.blinkenlights.nl (Postfix, from userid 101) id 3F5A431D; Tue, 3 May 2005 09:07:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by tea.blinkenlights.nl (Postfix) with ESMTP id 13EE130E; Tue, 3 May 2005 09:07:30 +0200 (CEST) Date: Tue, 3 May 2005 09:07:30 +0200 (CEST) From: Sten Spans To: Mike Silbersack In-Reply-To: <20050502194640.Q3199@odysseus.silby.com> Message-ID: References: <20050428135120.GB21428@cell.sick.ru> <427111BF.2050607@savvis.net><20050502180353.T787@odysseus.silby.com> <20050502194640.Q3199@odysseus.silby.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: harti@FreeBSD.org cc: Gleb Smirnoff cc: net@FreeBSD.org cc: jmg@FreeBSD.org Subject: Re: if_tap unaligned access problem X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2005 07:34:57 -0000 On Mon, 2 May 2005, Mike Silbersack wrote: > > On Tue, 3 May 2005, Sten Spans wrote: > >> For the if_tap case fixing the driver ( or rather changing m_uiotombuf ) >> is definately the correct solution. No sensible person would say otherwise. >> Once the if_tap change is properly tested and signed off it should >> make it into the tree. > > Yes, that makes sense. > >> But on the proposed alignment changes: >> >> If you would look at the netbsd url ( >> http://mail-index.netbsd.org/source-changes/2002/07/01/0001.html ) > > As I said above, just leave the IP stack alone and put the (conditional on > non-i386) code around line 731 of if_ethersubr.c: > > /* If the CRC is still on the packet, trim it off. */ > if (m->m_flags & M_HASFCS) { > m_adj(m, -ETHER_CRC_LEN); > m->m_flags &= ~M_HASFCS; > } > <-- here > switch (ether_type) { > #ifdef INET > case ETHERTYPE_IP: > > Then you cover all the protocols at once. Well it's pretty hard to only align the l3 protocol header in the ethernet code ... -- Sten Spans "There is a crack in everything, that's how the light gets in." Leonard Cohen - Anthem