On Wednesday 01 April 2015 20:18:21 Alex Suykov wrote:
batctl-2014.4.0 fails to build with musl, mostly because of somewhat weird netinet/*.h headers musl provides, but the problem turns out to be easy to fix.
musl does not allow including netinet/* and linux/* headers together. batctl includes netinet/if_ether.h indirectly via net/ethernet.h, so netinet/if_ether.h must be used instead of linux/if_ether.h.
__be16 and __be32 are linux-specific typedefs for uint16_t and uint32_t with __attribute__((bitwise)) that has no effect outside of the kernel. Replacing them with uint16_t and uint32_t removes dependency on linux/types.h.
Signed-off-by: Alex Suykov alex.suykov@gmail.com
Nacked-by: Sven Eckelmann sven@narfation.org
The __be32, __be16 are from the kernel and used there to check if data was correctly converted from host byte order to big endian (and the other way around). batctl just uses the packet.h from the kernel module. Removing them from the userspace would mean that it gets removed from the kernel module. This would mean that someone has send this "weird" commit to the next linux kernel maintainer. And I am quite happy that I will not be this person.
See https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-March/012926.html for a proposal how to provide headers which are not yet part of linux-libc-dev (linux kernel uapi headers).
Kind regards, Sven