aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/netfilter/xt_CT.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index 33a02b41abb4..0c8e43810ce3 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -14,6 +14,7 @@
14#include <linux/netfilter/x_tables.h> 14#include <linux/netfilter/x_tables.h>
15#include <linux/netfilter/xt_CT.h> 15#include <linux/netfilter/xt_CT.h>
16#include <net/netfilter/nf_conntrack.h> 16#include <net/netfilter/nf_conntrack.h>
17#include <net/netfilter/nf_conntrack_l4proto.h>
17#include <net/netfilter/nf_conntrack_helper.h> 18#include <net/netfilter/nf_conntrack_helper.h>
18#include <net/netfilter/nf_conntrack_ecache.h> 19#include <net/netfilter/nf_conntrack_ecache.h>
19#include <net/netfilter/nf_conntrack_l4proto.h> 20#include <net/netfilter/nf_conntrack_l4proto.h>
@@ -224,6 +225,7 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
224 225
225 if (timeout_find_get) { 226 if (timeout_find_get) {
226 const struct ipt_entry *e = par->entryinfo; 227 const struct ipt_entry *e = par->entryinfo;
228 struct nf_conntrack_l4proto *l4proto;
227 229
228 if (e->ip.invflags & IPT_INV_PROTO) { 230 if (e->ip.invflags & IPT_INV_PROTO) {
229 ret = -EINVAL; 231 ret = -EINVAL;
@@ -245,7 +247,12 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
245 info->timeout, timeout->l3num); 247 info->timeout, timeout->l3num);
246 goto err4; 248 goto err4;
247 } 249 }
248 if (timeout->l4proto->l4proto != e->ip.proto) { 250 /* Make sure the timeout policy matches any existing
251 * protocol tracker, otherwise default to generic.
252 */
253 l4proto = __nf_ct_l4proto_find(par->family,
254 e->ip.proto);
255 if (timeout->l4proto->l4proto != l4proto->l4proto) {
249 ret = -EINVAL; 256 ret = -EINVAL;
250 pr_info("Timeout policy `%s' can only be " 257 pr_info("Timeout policy `%s' can only be "
251 "used by L4 protocol number %d\n", 258 "used by L4 protocol number %d\n",