Date:2010-08-13 18:04:40 (13 years 7 months ago)
Author:jow
Commit:547bbf9b6ecdee816185820a4c43bc3be8ab6f7d
Message:[kernel] fixup 2.6.34 kernel headers to properly export XT_ALIGN() to userspace Ref: http://lkml.org/lkml/2010/4/13/118

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22621 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: target/linux/generic/patches-2.6.34/200-netfilter_xtables_align.patch (1 diff)

Change Details

target/linux/generic/patches-2.6.34/200-netfilter_xtables_align.patch
1--- a/include/linux/kernel.h
2@@ -4,6 +4,8 @@
3 /*
4  * 'kernel.h' contains some often-used function prototypes etc
5  */
6+#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
7+#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
8
9 #ifdef __KERNEL__
10
11@@ -37,8 +39,8 @@ extern const char linux_proc_banner[];
12
13 #define STACK_MAGIC 0xdeadbeef
14
15-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
16-#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
17+#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
18+#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
19 #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
20 #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
21
22--- a/include/linux/netfilter/x_tables.h
23@@ -1,6 +1,6 @@
24 #ifndef _X_TABLES_H
25 #define _X_TABLES_H
26-
27+#include <linux/kernel.h>
28 #include <linux/types.h>
29
30 #define XT_FUNCTION_MAXNAMELEN 30
31@@ -93,7 +93,7 @@ struct _xt_align {
32     __u64 u64;
33 };
34
35-#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align))
36+#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
37
38 /* Standard return verdict, or do jump. */
39 #define XT_STANDARD_TARGET ""
40@@ -598,7 +598,7 @@ struct _compat_xt_align {
41     compat_u64 u64;
42 };
43
44-#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align))
45+#define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align))
46
47 extern void xt_compat_lock(u_int8_t af);
48 extern void xt_compat_unlock(u_int8_t af);

Archive Download the corresponding diff file



interactive