RFC: Fix unaligned memory access
This is a mix of a bug report and a RFC, the bug report is that I had some problems with packets being dropped on the receiving side because of wrong checksums, and while investigating that I found some unaligned memory access warnings, which seemed to be the cause of the wrong checksums.
The RFC part is how I tried to fix that, but it is only lightly tested this and I am not sure that this is the better way to solve the issue for the project. I tried to keep the code as similar as I could to the original, so any deviation from the original "spirit" could be detected "at a glance".
I am thinking that adding (and using) the complete "get_unaligned + endianess conversion" calls (for example, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/asm-generic/unaligned.h#n60) could be a good idea, but opinions are welcome.
CFLAGS can be set on the make command line, e.g. make CFLAGS="-O3 -g".
For the misaligned access, I'd suggest to allocate a buffer on stack and memcpy the frame there with an offset of 6 bytes, which should make all the fields aligned. Similarly on the sender side, make the buffers larger by 6 bytes and adjust the data pointer. This should be simpler and maybe also faster.