Re: if_tap unaligned access problem
From: Maksim Yevmenkin (maksim.yevmenkin_at_savvis.net)
Date: 04/28/05
- Previous message: Gleb Smirnoff: "if_tap unaligned access problem"
- In reply to: Gleb Smirnoff: "if_tap unaligned access problem"
- Next in thread: Bruce M Simpson: "Re: if_tap unaligned access problem"
- Reply: Bruce M Simpson: "Re: if_tap unaligned access problem"
- Reply: Julian Elischer: "Re: if_tap unaligned access problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 28 Apr 2005 09:39:27 -0700 To: Gleb Smirnoff <glebius@FreeBSD.org>
Hello,
> 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.
i think we have few options here:
1) revert back original tapwrite function that was changed in v. 1.48
and set offset to 2 bytes in top mbuf
2) change current version of tapwrite so it would m_prepend and m_pullup
mbuf after m_uiotombuf
3) change m_uiotombuf to accept one more parameter - mbuf offset at
which data should be copied. there are not that many users of m_uiotombuf
/sys/kern/uipc_syscalls.c
/sys/net/if_tap.c
/sys/net/if_tun.c
/sys/netgraph/ng_device.c
> 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.
yes, that is true.
> Should I create a pr for this problem, or is there a simple
> quick fix possible ?
you probably should file pr. (1) and (2) above are quick fixes. (3) is
more complicated and, maybe, not desirable.
max
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
- Previous message: Gleb Smirnoff: "if_tap unaligned access problem"
- In reply to: Gleb Smirnoff: "if_tap unaligned access problem"
- Next in thread: Bruce M Simpson: "Re: if_tap unaligned access problem"
- Reply: Bruce M Simpson: "Re: if_tap unaligned access problem"
- Reply: Julian Elischer: "Re: if_tap unaligned access problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|