Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Apr 2005 17:51:20 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        net@FreeBSD.org
Cc:        Sten Spans <sten@blinkenlights.nl>
Subject:   if_tap unaligned access problem
Message-ID:  <20050428135120.GB21428@cell.sick.ru>

next in thread | raw e-mail | index | archive | help
Forward this to expose to wider audience.

----- Forwarded message from Sten Spans <sten@blinkenlights.nl> -----

From: Sten Spans <sten@blinkenlights.nl>
To: glebius@FreeBSD.org
Cc: Julian Elischer <julian@FreeBSD.org>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050428135120.GB21428>