if_tap unaligned access problem
Gleb Smirnoff
glebius at FreeBSD.org
Thu Apr 28 06:51:27 PDT 2005
Forward this to expose to wider audience.
----- Forwarded message from Sten Spans <sten at blinkenlights.nl> -----
From: Sten Spans <sten at blinkenlights.nl>
To: glebius at FreeBSD.org
Cc: Julian Elischer <julian at FreeBSD.org>
Subject: if_tap unaligned access problem
Date: Wed, 27 Apr 2005 14:54:29 +0200 (CEST)
Delivered-To: glebius at 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
More information about the freebsd-net
mailing list