diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-08-10 10:15:22 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-08-10 10:15:22 +0000 |
commit | 8dd6672941a399ae559a41beabb8764529907b99 (patch) | |
tree | 6f015d945c747d535e4647c7733cbaa772a51911 /target/linux | |
parent | 47f73ebe7b5ab4cc3a4a45a008967030f14c48cf (diff) | |
download | upstream-8dd6672941a399ae559a41beabb8764529907b99.tar.gz upstream-8dd6672941a399ae559a41beabb8764529907b99.tar.bz2 upstream-8dd6672941a399ae559a41beabb8764529907b99.zip |
netfilter: consider reply direction on selective flushing
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42095 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
6 files changed, 54 insertions, 36 deletions
diff --git a/target/linux/generic/patches-3.10/604-netfilter_conntrack_flush.patch b/target/linux/generic/patches-3.10/604-netfilter_conntrack_flush.patch index 1b5e2abbec..dd31f999a2 100644 --- a/target/linux/generic/patches-3.10/604-netfilter_conntrack_flush.patch +++ b/target/linux/generic/patches-3.10/604-netfilter_conntrack_flush.patch @@ -8,7 +8,7 @@ #include <net/net_namespace.h> #ifdef CONFIG_SYSCTL #include <linux/sysctl.h> -@@ -268,10 +269,63 @@ static int ct_open(struct inode *inode, +@@ -268,10 +269,66 @@ static int ct_open(struct inode *inode, sizeof(struct ct_iter_state)); } @@ -20,16 +20,19 @@ +static int kill_matching(struct nf_conn *i, void *data) +{ + struct kill_request *kr = data; -+ struct nf_conntrack_tuple *t = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t1 = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t2 = &i->tuplehash[IP_CT_DIR_REPLY].tuple; + + if (!kr->family) + return 1; + -+ if (t->src.l3num != kr->family) ++ if (t1->src.l3num != kr->family) + return 0; + -+ return (nf_inet_addr_cmp(&kr->addr, &t->src.u3) || -+ nf_inet_addr_cmp(&kr->addr, &t->dst.u3)); ++ return (nf_inet_addr_cmp(&kr->addr, &t1->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t1->dst.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3)); +} + +static ssize_t ct_file_write(struct file *file, const char __user *buf, @@ -72,7 +75,7 @@ .llseek = seq_lseek, .release = seq_release_net, }; -@@ -373,7 +427,7 @@ static int nf_conntrack_standalone_init_ +@@ -373,7 +430,7 @@ static int nf_conntrack_standalone_init_ { struct proc_dir_entry *pde; diff --git a/target/linux/generic/patches-3.13/604-netfilter_conntrack_flush.patch b/target/linux/generic/patches-3.13/604-netfilter_conntrack_flush.patch index a115e1c3f0..83cd04ac8b 100644 --- a/target/linux/generic/patches-3.13/604-netfilter_conntrack_flush.patch +++ b/target/linux/generic/patches-3.13/604-netfilter_conntrack_flush.patch @@ -8,7 +8,7 @@ #include <net/net_namespace.h> #ifdef CONFIG_SYSCTL #include <linux/sysctl.h> -@@ -268,10 +269,63 @@ static int ct_open(struct inode *inode, +@@ -268,10 +269,66 @@ static int ct_open(struct inode *inode, sizeof(struct ct_iter_state)); } @@ -20,16 +20,19 @@ +static int kill_matching(struct nf_conn *i, void *data) +{ + struct kill_request *kr = data; -+ struct nf_conntrack_tuple *t = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t1 = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t2 = &i->tuplehash[IP_CT_DIR_REPLY].tuple; + + if (!kr->family) + return 1; + -+ if (t->src.l3num != kr->family) ++ if (t1->src.l3num != kr->family) + return 0; + -+ return (nf_inet_addr_cmp(&kr->addr, &t->src.u3) || -+ nf_inet_addr_cmp(&kr->addr, &t->dst.u3)); ++ return (nf_inet_addr_cmp(&kr->addr, &t1->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t1->dst.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3)); +} + +static ssize_t ct_file_write(struct file *file, const char __user *buf, @@ -72,7 +75,7 @@ .llseek = seq_lseek, .release = seq_release_net, }; -@@ -373,7 +427,7 @@ static int nf_conntrack_standalone_init_ +@@ -373,7 +430,7 @@ static int nf_conntrack_standalone_init_ { struct proc_dir_entry *pde; diff --git a/target/linux/generic/patches-3.14/604-netfilter_conntrack_flush.patch b/target/linux/generic/patches-3.14/604-netfilter_conntrack_flush.patch index a115e1c3f0..83cd04ac8b 100644 --- a/target/linux/generic/patches-3.14/604-netfilter_conntrack_flush.patch +++ b/target/linux/generic/patches-3.14/604-netfilter_conntrack_flush.patch @@ -8,7 +8,7 @@ #include <net/net_namespace.h> #ifdef CONFIG_SYSCTL #include <linux/sysctl.h> -@@ -268,10 +269,63 @@ static int ct_open(struct inode *inode, +@@ -268,10 +269,66 @@ static int ct_open(struct inode *inode, sizeof(struct ct_iter_state)); } @@ -20,16 +20,19 @@ +static int kill_matching(struct nf_conn *i, void *data) +{ + struct kill_request *kr = data; -+ struct nf_conntrack_tuple *t = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t1 = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t2 = &i->tuplehash[IP_CT_DIR_REPLY].tuple; + + if (!kr->family) + return 1; + -+ if (t->src.l3num != kr->family) ++ if (t1->src.l3num != kr->family) + return 0; + -+ return (nf_inet_addr_cmp(&kr->addr, &t->src.u3) || -+ nf_inet_addr_cmp(&kr->addr, &t->dst.u3)); ++ return (nf_inet_addr_cmp(&kr->addr, &t1->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t1->dst.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3)); +} + +static ssize_t ct_file_write(struct file *file, const char __user *buf, @@ -72,7 +75,7 @@ .llseek = seq_lseek, .release = seq_release_net, }; -@@ -373,7 +427,7 @@ static int nf_conntrack_standalone_init_ +@@ -373,7 +430,7 @@ static int nf_conntrack_standalone_init_ { struct proc_dir_entry *pde; diff --git a/target/linux/generic/patches-3.3/604-netfilter_conntrack_flush.patch b/target/linux/generic/patches-3.3/604-netfilter_conntrack_flush.patch index 3f510a9ad2..a17ba1cf80 100644 --- a/target/linux/generic/patches-3.3/604-netfilter_conntrack_flush.patch +++ b/target/linux/generic/patches-3.3/604-netfilter_conntrack_flush.patch @@ -8,7 +8,7 @@ #include <net/net_namespace.h> #ifdef CONFIG_SYSCTL #include <linux/sysctl.h> -@@ -267,10 +268,63 @@ static int ct_open(struct inode *inode, +@@ -267,10 +268,66 @@ static int ct_open(struct inode *inode, sizeof(struct ct_iter_state)); } @@ -20,16 +20,19 @@ +static int kill_matching(struct nf_conn *i, void *data) +{ + struct kill_request *kr = data; -+ struct nf_conntrack_tuple *t = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t1 = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t2 = &i->tuplehash[IP_CT_DIR_REPLY].tuple; + + if (!kr->family) + return 1; + -+ if (t->src.l3num != kr->family) ++ if (t1->src.l3num != kr->family) + return 0; + -+ return (nf_inet_addr_cmp(&kr->addr, &t->src.u3) || -+ nf_inet_addr_cmp(&kr->addr, &t->dst.u3)); ++ return (nf_inet_addr_cmp(&kr->addr, &t1->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t1->dst.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3)); +} + +static ssize_t ct_file_write(struct file *file, const char __user *buf, @@ -72,7 +75,7 @@ .llseek = seq_lseek, .release = seq_release_net, }; -@@ -372,7 +426,7 @@ static int nf_conntrack_standalone_init_ +@@ -372,7 +429,7 @@ static int nf_conntrack_standalone_init_ { struct proc_dir_entry *pde; diff --git a/target/linux/generic/patches-3.8/604-netfilter_conntrack_flush.patch b/target/linux/generic/patches-3.8/604-netfilter_conntrack_flush.patch index 3f510a9ad2..a17ba1cf80 100644 --- a/target/linux/generic/patches-3.8/604-netfilter_conntrack_flush.patch +++ b/target/linux/generic/patches-3.8/604-netfilter_conntrack_flush.patch @@ -8,7 +8,7 @@ #include <net/net_namespace.h> #ifdef CONFIG_SYSCTL #include <linux/sysctl.h> -@@ -267,10 +268,63 @@ static int ct_open(struct inode *inode, +@@ -267,10 +268,66 @@ static int ct_open(struct inode *inode, sizeof(struct ct_iter_state)); } @@ -20,16 +20,19 @@ +static int kill_matching(struct nf_conn *i, void *data) +{ + struct kill_request *kr = data; -+ struct nf_conntrack_tuple *t = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t1 = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t2 = &i->tuplehash[IP_CT_DIR_REPLY].tuple; + + if (!kr->family) + return 1; + -+ if (t->src.l3num != kr->family) ++ if (t1->src.l3num != kr->family) + return 0; + -+ return (nf_inet_addr_cmp(&kr->addr, &t->src.u3) || -+ nf_inet_addr_cmp(&kr->addr, &t->dst.u3)); ++ return (nf_inet_addr_cmp(&kr->addr, &t1->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t1->dst.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3)); +} + +static ssize_t ct_file_write(struct file *file, const char __user *buf, @@ -72,7 +75,7 @@ .llseek = seq_lseek, .release = seq_release_net, }; -@@ -372,7 +426,7 @@ static int nf_conntrack_standalone_init_ +@@ -372,7 +429,7 @@ static int nf_conntrack_standalone_init_ { struct proc_dir_entry *pde; diff --git a/target/linux/generic/patches-3.9/604-netfilter_conntrack_flush.patch b/target/linux/generic/patches-3.9/604-netfilter_conntrack_flush.patch index 39a3e71e21..188bd2e499 100644 --- a/target/linux/generic/patches-3.9/604-netfilter_conntrack_flush.patch +++ b/target/linux/generic/patches-3.9/604-netfilter_conntrack_flush.patch @@ -8,7 +8,7 @@ #include <net/net_namespace.h> #ifdef CONFIG_SYSCTL #include <linux/sysctl.h> -@@ -267,10 +268,63 @@ static int ct_open(struct inode *inode, +@@ -267,10 +268,66 @@ static int ct_open(struct inode *inode, sizeof(struct ct_iter_state)); } @@ -20,16 +20,19 @@ +static int kill_matching(struct nf_conn *i, void *data) +{ + struct kill_request *kr = data; -+ struct nf_conntrack_tuple *t = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t1 = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t2 = &i->tuplehash[IP_CT_DIR_REPLY].tuple; + + if (!kr->family) + return 1; + -+ if (t->src.l3num != kr->family) ++ if (t1->src.l3num != kr->family) + return 0; + -+ return (nf_inet_addr_cmp(&kr->addr, &t->src.u3) || -+ nf_inet_addr_cmp(&kr->addr, &t->dst.u3)); ++ return (nf_inet_addr_cmp(&kr->addr, &t1->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t1->dst.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3)); +} + +static ssize_t ct_file_write(struct file *file, const char __user *buf, @@ -72,7 +75,7 @@ .llseek = seq_lseek, .release = seq_release_net, }; -@@ -372,7 +426,7 @@ static int nf_conntrack_standalone_init_ +@@ -372,7 +429,7 @@ static int nf_conntrack_standalone_init_ { struct proc_dir_entry *pde; |