diff options
-rw-r--r-- | include/linux/netfilter/nf_conntrack_common.h | 4 | ||||
-rw-r--r-- | include/linux/netfilter/nfnetlink_conntrack.h | 1 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_expect.h | 3 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 8 |
4 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index 1afd18c855ec..fdc50cae861f 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
@@ -100,6 +100,10 @@ enum ip_conntrack_expect_events { | |||
100 | IPEXP_NEW, /* new expectation */ | 100 | IPEXP_NEW, /* new expectation */ |
101 | }; | 101 | }; |
102 | 102 | ||
103 | /* expectation flags */ | ||
104 | #define NF_CT_EXPECT_PERMANENT 0x1 | ||
105 | #define NF_CT_EXPECT_INACTIVE 0x2 | ||
106 | |||
103 | #ifdef __KERNEL__ | 107 | #ifdef __KERNEL__ |
104 | struct ip_conntrack_stat { | 108 | struct ip_conntrack_stat { |
105 | unsigned int searched; | 109 | unsigned int searched; |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 9ed534c991b9..455f0ce4f430 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -161,6 +161,7 @@ enum ctattr_expect { | |||
161 | CTA_EXPECT_ID, | 161 | CTA_EXPECT_ID, |
162 | CTA_EXPECT_HELP_NAME, | 162 | CTA_EXPECT_HELP_NAME, |
163 | CTA_EXPECT_ZONE, | 163 | CTA_EXPECT_ZONE, |
164 | CTA_EXPECT_FLAGS, | ||
164 | __CTA_EXPECT_MAX | 165 | __CTA_EXPECT_MAX |
165 | }; | 166 | }; |
166 | #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) | 167 | #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 11e815084fcf..96bb42af5fae 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -67,9 +67,6 @@ struct nf_conntrack_expect_policy { | |||
67 | 67 | ||
68 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 | 68 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 |
69 | 69 | ||
70 | #define NF_CT_EXPECT_PERMANENT 0x1 | ||
71 | #define NF_CT_EXPECT_INACTIVE 0x2 | ||
72 | |||
73 | int nf_conntrack_expect_init(struct net *net); | 70 | int nf_conntrack_expect_init(struct net *net); |
74 | void nf_conntrack_expect_fini(struct net *net); | 71 | void nf_conntrack_expect_fini(struct net *net); |
75 | 72 | ||
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 37533a30413b..0804e0ef6500 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1577,6 +1577,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb, | |||
1577 | 1577 | ||
1578 | NLA_PUT_BE32(skb, CTA_EXPECT_TIMEOUT, htonl(timeout)); | 1578 | NLA_PUT_BE32(skb, CTA_EXPECT_TIMEOUT, htonl(timeout)); |
1579 | NLA_PUT_BE32(skb, CTA_EXPECT_ID, htonl((unsigned long)exp)); | 1579 | NLA_PUT_BE32(skb, CTA_EXPECT_ID, htonl((unsigned long)exp)); |
1580 | NLA_PUT_BE32(skb, CTA_EXPECT_FLAGS, htonl(exp->flags)); | ||
1580 | helper = rcu_dereference(nfct_help(master)->helper); | 1581 | helper = rcu_dereference(nfct_help(master)->helper); |
1581 | if (helper) | 1582 | if (helper) |
1582 | NLA_PUT_STRING(skb, CTA_EXPECT_HELP_NAME, helper->name); | 1583 | NLA_PUT_STRING(skb, CTA_EXPECT_HELP_NAME, helper->name); |
@@ -1734,6 +1735,7 @@ static const struct nla_policy exp_nla_policy[CTA_EXPECT_MAX+1] = { | |||
1734 | [CTA_EXPECT_ID] = { .type = NLA_U32 }, | 1735 | [CTA_EXPECT_ID] = { .type = NLA_U32 }, |
1735 | [CTA_EXPECT_HELP_NAME] = { .type = NLA_NUL_STRING }, | 1736 | [CTA_EXPECT_HELP_NAME] = { .type = NLA_NUL_STRING }, |
1736 | [CTA_EXPECT_ZONE] = { .type = NLA_U16 }, | 1737 | [CTA_EXPECT_ZONE] = { .type = NLA_U16 }, |
1738 | [CTA_EXPECT_FLAGS] = { .type = NLA_U32 }, | ||
1737 | }; | 1739 | }; |
1738 | 1740 | ||
1739 | static int | 1741 | static int |
@@ -1933,9 +1935,13 @@ ctnetlink_create_expect(struct net *net, u16 zone, | |||
1933 | goto out; | 1935 | goto out; |
1934 | } | 1936 | } |
1935 | 1937 | ||
1938 | if (cda[CTA_EXPECT_FLAGS]) | ||
1939 | exp->flags = ntohl(nla_get_be32(cda[CTA_EXPECT_FLAGS])); | ||
1940 | else | ||
1941 | exp->flags = 0; | ||
1942 | |||
1936 | exp->class = 0; | 1943 | exp->class = 0; |
1937 | exp->expectfn = NULL; | 1944 | exp->expectfn = NULL; |
1938 | exp->flags = 0; | ||
1939 | exp->master = ct; | 1945 | exp->master = ct; |
1940 | exp->helper = NULL; | 1946 | exp->helper = NULL; |
1941 | memcpy(&exp->tuple, &tuple, sizeof(struct nf_conntrack_tuple)); | 1947 | memcpy(&exp->tuple, &tuple, sizeof(struct nf_conntrack_tuple)); |