[PATCH] Fix alignment of headers in the packet buffer

33 views
Skip to first unread message

Michael Tüxen

unread,
Dec 23, 2014, 7:35:33 PM12/23/14
to packe...@googlegroups.com, Neal Cardwell
Hi Neal,

this patch makes sure that all heaaders start at a four byte
boundary. This is done by not having the ethernet header, which
is 14 bytes long, in the packet buffer.
This fixes the remote mode for platforms having strict alignment
restrictions, like ARM. Without this patch you can't use the remote
mode on a Rasperry Pi running FreeBSD.
This patch has been tested on Linux (Intel) in local and remote mode
and one FreeBSD (Intel and ARM) in local and remote mode.

Signed-off-by: Michael Tuexen <tue...@fh-muenster.de>

Please note that this patch depends on
0001-Bugfix-Let-packet_socket_receive-honor-the-direction.patch

Please note also that checkpatch.pl complains about the __aligned
macro I define in types.h, but I don't think this can be avoided.

And please not finally, that you need some further changes to
0001-Add-support-for-UDPLite-RFC-3828.patch:
* You need to add the corresponding __aligned(4) attributes to the
UDPLite packets.
* You need to change the calls to parse_packet() in the test routines.

It is getting hard to keep the patches as independent as possible...

Best regards
Michael

0001-Fix-alignment-of-headers-in-the-packet-buffer.patch

Michael Tüxen

unread,
Dec 27, 2014, 3:05:13 PM12/27/14
to packe...@googlegroups.com, ncar...@google.com
Improved patch:
* Use bool instead of int as the type of a boolean variable
* print the ether_type consistently using 4 hex digits.


0001-Fix-alignment-of-headers-in-the-packet-buffer.patch
Reply all
Reply to author
Forward
0 new messages