summaryrefslogtreecommitdiff
path: root/target/linux
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-10-05 09:21:12 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-10-05 09:21:12 +0000
commit7bab42f05f60806bf4b7ba63688d96b68142c80b (patch)
tree97fb06782193845d1b759ce07286a7c3939bf1ab /target/linux
parentc2ace55782c1f0aa227e8b7a2e1cc9b784cd5f9b (diff)
[kernel] 2.6.27: revert case insensitive match support in xt_string while we are using iptables-1.4.0
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12862 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic-2.6/patches-2.6.27/952-revert_xt_string_case_insensitive_match.patch112
1 files changed, 112 insertions, 0 deletions
diff --git a/target/linux/generic-2.6/patches-2.6.27/952-revert_xt_string_case_insensitive_match.patch b/target/linux/generic-2.6/patches-2.6.27/952-revert_xt_string_case_insensitive_match.patch
new file mode 100644
index 0000000000..4902db1585
--- /dev/null
+++ b/target/linux/generic-2.6/patches-2.6.27/952-revert_xt_string_case_insensitive_match.patch
@@ -0,0 +1,112 @@
+--- a/include/linux/netfilter/xt_string.h
++++ b/include/linux/netfilter/xt_string.h
+@@ -4,11 +4,6 @@
+ #define XT_STRING_MAX_PATTERN_SIZE 128
+ #define XT_STRING_MAX_ALGO_NAME_SIZE 16
+
+-enum {
+- XT_STRING_FLAG_INVERT = 0x01,
+- XT_STRING_FLAG_IGNORECASE = 0x02
+-};
+-
+ struct xt_string_info
+ {
+ u_int16_t from_offset;
+@@ -16,15 +11,7 @@
+ char algo[XT_STRING_MAX_ALGO_NAME_SIZE];
+ char pattern[XT_STRING_MAX_PATTERN_SIZE];
+ u_int8_t patlen;
+- union {
+- struct {
+- u_int8_t invert;
+- } v0;
+-
+- struct {
+- u_int8_t flags;
+- } v1;
+- } u;
++ u_int8_t invert;
+
+ /* Used internally by the kernel */
+ struct ts_config __attribute__((aligned(8))) *config;
+--- a/net/netfilter/xt_string.c
++++ b/net/netfilter/xt_string.c
+@@ -29,16 +29,12 @@
+ {
+ const struct xt_string_info *conf = matchinfo;
+ struct ts_state state;
+- int invert;
+
+ memset(&state, 0, sizeof(struct ts_state));
+
+- invert = (match->revision == 0 ? conf->u.v0.invert :
+- conf->u.v1.flags & XT_STRING_FLAG_INVERT);
+-
+ return (skb_find_text((struct sk_buff *)skb, conf->from_offset,
+ conf->to_offset, conf->config, &state)
+- != UINT_MAX) ^ invert;
++ != UINT_MAX) ^ conf->invert;
+ }
+
+ #define STRING_TEXT_PRIV(m) ((struct xt_string_info *)(m))
+@@ -50,7 +46,6 @@
+ {
+ struct xt_string_info *conf = matchinfo;
+ struct ts_config *ts_conf;
+- int flags = TS_AUTOLOAD;
+
+ /* Damn, can't handle this case properly with iptables... */
+ if (conf->from_offset > conf->to_offset)
+@@ -59,15 +54,8 @@
+ return false;
+ if (conf->patlen > XT_STRING_MAX_PATTERN_SIZE)
+ return false;
+- if (match->revision == 1) {
+- if (conf->u.v1.flags &
+- ~(XT_STRING_FLAG_IGNORECASE | XT_STRING_FLAG_INVERT))
+- return false;
+- if (conf->u.v1.flags & XT_STRING_FLAG_IGNORECASE)
+- flags |= TS_IGNORECASE;
+- }
+ ts_conf = textsearch_prepare(conf->algo, conf->pattern, conf->patlen,
+- GFP_KERNEL, flags);
++ GFP_KERNEL, TS_AUTOLOAD);
+ if (IS_ERR(ts_conf))
+ return false;
+
+@@ -84,17 +72,6 @@
+ static struct xt_match string_mt_reg[] __read_mostly = {
+ {
+ .name = "string",
+- .revision = 0,
+- .family = AF_INET,
+- .checkentry = string_mt_check,
+- .match = string_mt,
+- .destroy = string_mt_destroy,
+- .matchsize = sizeof(struct xt_string_info),
+- .me = THIS_MODULE
+- },
+- {
+- .name = "string",
+- .revision = 1,
+ .family = AF_INET,
+ .checkentry = string_mt_check,
+ .match = string_mt,
+@@ -104,17 +81,6 @@
+ },
+ {
+ .name = "string",
+- .revision = 0,
+- .family = AF_INET6,
+- .checkentry = string_mt_check,
+- .match = string_mt,
+- .destroy = string_mt_destroy,
+- .matchsize = sizeof(struct xt_string_info),
+- .me = THIS_MODULE
+- },
+- {
+- .name = "string",
+- .revision = 1,
+ .family = AF_INET6,
+ .checkentry = string_mt_check,
+ .match = string_mt,