From owner-freebsd-net@FreeBSD.ORG Thu Apr 28 13:51:27 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 09EBF16A4CE for ; Thu, 28 Apr 2005 13:51:27 +0000 (GMT) Received: from relay.bestcom.ru (relay.bestcom.ru [217.72.144.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3784C43D1F for ; Thu, 28 Apr 2005 13:51:26 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (root@cell.sick.ru [217.72.144.68]) by relay.bestcom.ru (8.13.1/8.12.9) with ESMTP id j3SDpKuV040683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 28 Apr 2005 17:51:21 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.1/8.12.8) with ESMTP id j3SDpKM1021531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Apr 2005 17:51:20 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.1/8.13.1/Submit) id j3SDpKrY021530; Thu, 28 Apr 2005 17:51:20 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 28 Apr 2005 17:51:20 +0400 From: Gleb Smirnoff To: net@FreeBSD.org Message-ID: <20050428135120.GB21428@cell.sick.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV version devel-20050125, clamav-milter version 0.80ff on relay.bestcom.ru X-Virus-Status: Clean cc: Sten Spans Subject: 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: Thu, 28 Apr 2005 13:51:27 -0000 Forward this to expose to wider audience. ----- Forwarded message from Sten Spans ----- From: Sten Spans To: glebius@FreeBSD.org Cc: Julian Elischer Subject: if_tap unaligned access problem Date: Wed, 27 Apr 2005 14:54:29 +0200 (CEST) Delivered-To: glebius@freebsd.org A quick question about if_tap, the tapwrite function ( which copies an ethernet frame into an mbuf using uiotombuf ) is broken on alpha and sparc64. The 14 byte ethernet header causes the rest of the frame to be misaligned on 4 byte boundaries. This causes crashes in various other parts of the kernel. The solution would be to shift the mbuf by two bytes, but I am not quite sure where this should happen. If_tun which is almost the same code has no such problem because it lacks the 14 byte ethernet header. Openbsd has a combined tun/tap driver, with some alignment hacks to fix this. Should I create a pr for this problem, or is there a simple quick fix possible ? -- Sten Spans "There is a crack in everything, that's how the light gets in." Leonard Cohen - Anthem ----- End forwarded message ----- -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE