diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-08-13 16:04:40 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-08-13 16:04:40 +0000 |
commit | 8db0749823cbd2584bc3cc15d77d9e0942dc084b (patch) | |
tree | 77d418fc4f517307efc9a89dce58c01fcca0b499 /target/linux | |
parent | a8e2cc2534201d7aa7914f7b8c9be801114b086d (diff) | |
download | master-31e0f0ae-8db0749823cbd2584bc3cc15d77d9e0942dc084b.tar.gz master-31e0f0ae-8db0749823cbd2584bc3cc15d77d9e0942dc084b.tar.bz2 master-31e0f0ae-8db0749823cbd2584bc3cc15d77d9e0942dc084b.zip |
fixup 2.6.34 kernel headers to properly export XT_ALIGN() to userspace Ref: http://lkml.org/lkml/2010/4/13/118
SVN-Revision: 22621
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/generic/patches-2.6.34/200-netfilter_xtables_align.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/generic/patches-2.6.34/200-netfilter_xtables_align.patch b/target/linux/generic/patches-2.6.34/200-netfilter_xtables_align.patch new file mode 100644 index 0000000000..f25e2c8347 --- /dev/null +++ b/target/linux/generic/patches-2.6.34/200-netfilter_xtables_align.patch @@ -0,0 +1,50 @@ +--- a/include/linux/kernel.h ++++ b/include/linux/kernel.h +@@ -4,6 +4,8 @@ + /* + * 'kernel.h' contains some often-used function prototypes etc + */ ++#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) ++#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) + + #ifdef __KERNEL__ + +@@ -37,8 +39,8 @@ extern const char linux_proc_banner[]; + + #define STACK_MAGIC 0xdeadbeef + +-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) +-#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) ++#define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) ++#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) + #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) + #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) + +--- a/include/linux/netfilter/x_tables.h ++++ b/include/linux/netfilter/x_tables.h +@@ -1,6 +1,6 @@ + #ifndef _X_TABLES_H + #define _X_TABLES_H +- ++#include <linux/kernel.h> + #include <linux/types.h> + + #define XT_FUNCTION_MAXNAMELEN 30 +@@ -93,7 +93,7 @@ struct _xt_align { + __u64 u64; + }; + +-#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align)) ++#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align)) + + /* Standard return verdict, or do jump. */ + #define XT_STANDARD_TARGET "" +@@ -598,7 +598,7 @@ struct _compat_xt_align { + compat_u64 u64; + }; + +-#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align)) ++#define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align)) + + extern void xt_compat_lock(u_int8_t af); + extern void xt_compat_unlock(u_int8_t af); |