the following patch separates the openwrt patch changes from the vanilla
layer7 kernel patch in order to make the upgrade process easier and
cleaner. tested against layer7 vanilla
kernel-2.6.22-2.6.24-layer7-2.17.patch & kernel-2.6.25-layer7-2.20.patch
on a 2.6.27.4 openwrt kernel.
Signed-off-by: Alexandros C. Couloumbis
diff -Nrub linux-2.6.27.4.old/net/netfilter/nf_conntrack_standalone.c
linux-2.6.27.4/net/netfilter/nf_conntrack_standalone.c
--- linux-2.6.27.4.old/net/netfilter/nf_conntrack_standalone.c
2008-11-04 11:55:18.000000000 +0200
+++ linux-2.6.27.4/net/netfilter/nf_conntrack_standalone.c
2008-11-04 11:56:44.000000000 +0200
@@ -162,7 +162,12 @@
return -ENOSPC;
#endif
- if (seq_printf(s, "use=%u\n", atomic_read(&ct->ct_general.use)))
+#if defined(CONFIG_NETFILTER_XT_MATCH_LAYER7) ||
defined(CONFIG_NETFILTER_XT_MATCH_LAYER7_MODULE)
+ if(ct->layer7.app_proto)
+ if(seq_printf(s, "l7proto=%s ", ct->layer7.app_proto))
+ return -ENOSPC;
+#endif
+ if (seq_printf(s, "asdfuse=%u\n", atomic_read(&ct->ct_general.use)))
return -ENOSPC;
return 0;
diff -Nrub linux-2.6.27.4.old/net/netfilter/xt_layer7.c
linux-2.6.27.4/net/netfilter/xt_layer7.c
--- linux-2.6.27.4.old/net/netfilter/xt_layer7.c 2008-11-04
11:55:18.000000000 +0200
+++ linux-2.6.27.4/net/netfilter/xt_layer7.c 2008-11-04
11:56:44.000000000 +0200
@@ -395,7 +395,7 @@
return count;
}
-static int
+static bool
match(const struct sk_buff *skbin,
const struct net_device *in,
const struct net_device *out,
@@ -403,7 +403,7 @@
const void *matchinfo,
int offset,
unsigned int protoff,
- int *hotdrop)
+ bool *hotdrop)
{
/* sidestep const without getting a compiler warning... */
struct sk_buff * skb = (struct sk_buff *)skbin;
@@ -547,7 +547,7 @@
return (pattern_result ^ info->invert);
}
-static int check(const char *tablename,
+static bool check(const char *tablename,
const void *inf,
const struct xt_match *match,
void *matchinfo,
@@ -558,9 +558,9 @@
if (nf_ct_l3proto_try_module_get(match->family) < 0) {
printk(KERN_WARNING "can't load conntrack support for "
"proto=%d\n", match->family);
- return 0;
+ return false;
}
- return 1;
+ return true;
}
static void
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel