kernel: add support for linux 3.2.1
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.2 / 602-netfilter_layer7_match.patch
1 --- a/net/netfilter/xt_layer7.c
2 +++ b/net/netfilter/xt_layer7.c
3 @@ -415,7 +415,9 @@ static int layer7_write_proc(struct file
4 }
5
6 static bool
7 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
8 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
9 +match(const struct sk_buff *skbin, struct xt_action_param *par)
10 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
11 match(const struct sk_buff *skbin, const struct xt_match_param *par)
12 #else
13 match(const struct sk_buff *skbin,
14 @@ -597,14 +599,19 @@ match(const struct sk_buff *skbin,
15 }
16
17 // load nf_conntrack_ipv4
18 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
19 +static int
20 +#else
21 +static bool
22 +#endif
23 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
24 -static bool check(const struct xt_mtchk_param *par)
25 +check(const struct xt_mtchk_param *par)
26 {
27 if (nf_ct_l3proto_try_module_get(par->match->family) < 0) {
28 printk(KERN_WARNING "can't load conntrack support for "
29 "proto=%d\n", par->match->family);
30 #else
31 -static bool check(const char *tablename, const void *inf,
32 +check(const char *tablename, const void *inf,
33 const struct xt_match *match, void *matchinfo,
34 unsigned int hook_mask)
35 {
36 @@ -612,9 +619,15 @@ static bool check(const char *tablename,
37 printk(KERN_WARNING "can't load conntrack support for "
38 "proto=%d\n", match->family);
39 #endif
40 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
41 + return -EINVAL;
42 + }
43 + return 0;
44 +#else
45 return 0;
46 }
47 return 1;
48 +#endif
49 }
50
51