[PATCH] don't use __be16 in files used by userspace
David S. Miller
davem at davemloft.net
Fri Oct 7 22:24:56 CEST 2005
From: Harald Welte <laforge at netfilter.org>
Date: Fri, 7 Oct 2005 12:31:05 +0200
> This (or a different solution such as
> "#ifndef __KERNEL__ #define __be16 #endif" needs to go in before 2.6.14
> is released, since otherwise we'd break userspace compilation :(
I'm not applying this.
The reverting of endianness annotations would be a serious
regression. If we need userland compatible defines we can
1) Do what iproute2 and friends do, which is ship sanitized
kernel headers in their userland source tree.
2) As you suggest have a suitable __be* et al. define when
__KERNEL__ is not set.
Actually... What's the problem anyways? #2 seems to already
In linux/types.h we have:
#define __bitwise __attribute__((bitwise))
typedef __u16 __bitwise __le16;
typedef __u16 __bitwise __be16;
typedef __u32 __bitwise __le32;
typedef __u32 __bitwise __be32;
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __u64 __bitwise __le64;
typedef __u64 __bitwise __be64;
And this should just work.
That isn't even protected by __KERNEL__, it's fully visible to
userspace when you include linux/types.h
More information about the netfilter-devel