diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-16 14:15:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-16 14:15:13 -0500 |
commit | 749f621e20ab0db35a15ff730088922603c809ba (patch) | |
tree | 2684d12199b58f2b9e0c5b7e6cc0ea3f002e611a /include/net | |
parent | 339c6e99853d2ef1f02ad8a313e079050a300427 (diff) | |
parent | 3e5e524ffb5fcf2447eb5dd9f8e54ad22dd9baa7 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip.h | 3 | ||||
-rw-r--r-- | include/net/ip_vs.h | 16 | ||||
-rw-r--r-- | include/net/ipv6.h | 5 | ||||
-rw-r--r-- | include/net/net_namespace.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 12 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_core.h | 3 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_ecache.h | 58 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_expect.h | 16 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_extend.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_helper.h | 8 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_l4proto.h | 4 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_zones.h | 23 | ||||
-rw-r--r-- | include/net/netfilter/nf_nat_helper.h | 32 | ||||
-rw-r--r-- | include/net/netns/ipv4.h | 2 | ||||
-rw-r--r-- | include/net/netns/ipv6.h | 2 |
15 files changed, 124 insertions, 64 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index fb63371c07a8..7bc47873e3fc 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -352,8 +352,11 @@ enum ip_defrag_users { | |||
352 | IP_DEFRAG_LOCAL_DELIVER, | 352 | IP_DEFRAG_LOCAL_DELIVER, |
353 | IP_DEFRAG_CALL_RA_CHAIN, | 353 | IP_DEFRAG_CALL_RA_CHAIN, |
354 | IP_DEFRAG_CONNTRACK_IN, | 354 | IP_DEFRAG_CONNTRACK_IN, |
355 | __IP_DEFRAG_CONNTRACK_IN_END = IP_DEFRAG_CONNTRACK_IN + USHORT_MAX, | ||
355 | IP_DEFRAG_CONNTRACK_OUT, | 356 | IP_DEFRAG_CONNTRACK_OUT, |
357 | __IP_DEFRAG_CONNTRACK_OUT_END = IP_DEFRAG_CONNTRACK_OUT + USHORT_MAX, | ||
356 | IP_DEFRAG_CONNTRACK_BRIDGE_IN, | 358 | IP_DEFRAG_CONNTRACK_BRIDGE_IN, |
359 | __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHORT_MAX, | ||
357 | IP_DEFRAG_VS_IN, | 360 | IP_DEFRAG_VS_IN, |
358 | IP_DEFRAG_VS_OUT, | 361 | IP_DEFRAG_VS_OUT, |
359 | IP_DEFRAG_VS_FWD | 362 | IP_DEFRAG_VS_FWD |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 8dc3296b7bea..a816c37417bb 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -26,6 +26,11 @@ | |||
26 | #include <linux/ipv6.h> /* for struct ipv6hdr */ | 26 | #include <linux/ipv6.h> /* for struct ipv6hdr */ |
27 | #include <net/ipv6.h> /* for ipv6_addr_copy */ | 27 | #include <net/ipv6.h> /* for ipv6_addr_copy */ |
28 | 28 | ||
29 | |||
30 | /* Connections' size value needed by ip_vs_ctl.c */ | ||
31 | extern int ip_vs_conn_tab_size; | ||
32 | |||
33 | |||
29 | struct ip_vs_iphdr { | 34 | struct ip_vs_iphdr { |
30 | int len; | 35 | int len; |
31 | __u8 protocol; | 36 | __u8 protocol; |
@@ -592,17 +597,6 @@ extern void ip_vs_init_hash_table(struct list_head *table, int rows); | |||
592 | * (from ip_vs_conn.c) | 597 | * (from ip_vs_conn.c) |
593 | */ | 598 | */ |
594 | 599 | ||
595 | /* | ||
596 | * IPVS connection entry hash table | ||
597 | */ | ||
598 | #ifndef CONFIG_IP_VS_TAB_BITS | ||
599 | #define CONFIG_IP_VS_TAB_BITS 12 | ||
600 | #endif | ||
601 | |||
602 | #define IP_VS_CONN_TAB_BITS CONFIG_IP_VS_TAB_BITS | ||
603 | #define IP_VS_CONN_TAB_SIZE (1 << IP_VS_CONN_TAB_BITS) | ||
604 | #define IP_VS_CONN_TAB_MASK (IP_VS_CONN_TAB_SIZE - 1) | ||
605 | |||
606 | enum { | 600 | enum { |
607 | IP_VS_DIR_INPUT = 0, | 601 | IP_VS_DIR_INPUT = 0, |
608 | IP_VS_DIR_OUTPUT, | 602 | IP_VS_DIR_OUTPUT, |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index ccab5946c830..639ec53ea081 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -246,6 +246,8 @@ extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb); | |||
246 | int ip6_frag_nqueues(struct net *net); | 246 | int ip6_frag_nqueues(struct net *net); |
247 | int ip6_frag_mem(struct net *net); | 247 | int ip6_frag_mem(struct net *net); |
248 | 248 | ||
249 | #define IPV6_FRAG_HIGH_THRESH 262144 /* == 256*1024 */ | ||
250 | #define IPV6_FRAG_LOW_THRESH 196608 /* == 192*1024 */ | ||
249 | #define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ | 251 | #define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ |
250 | 252 | ||
251 | extern int __ipv6_addr_type(const struct in6_addr *addr); | 253 | extern int __ipv6_addr_type(const struct in6_addr *addr); |
@@ -353,8 +355,11 @@ struct inet_frag_queue; | |||
353 | enum ip6_defrag_users { | 355 | enum ip6_defrag_users { |
354 | IP6_DEFRAG_LOCAL_DELIVER, | 356 | IP6_DEFRAG_LOCAL_DELIVER, |
355 | IP6_DEFRAG_CONNTRACK_IN, | 357 | IP6_DEFRAG_CONNTRACK_IN, |
358 | __IP6_DEFRAG_CONNTRACK_IN = IP6_DEFRAG_CONNTRACK_IN + USHORT_MAX, | ||
356 | IP6_DEFRAG_CONNTRACK_OUT, | 359 | IP6_DEFRAG_CONNTRACK_OUT, |
360 | __IP6_DEFRAG_CONNTRACK_OUT = IP6_DEFRAG_CONNTRACK_OUT + USHORT_MAX, | ||
357 | IP6_DEFRAG_CONNTRACK_BRIDGE_IN, | 361 | IP6_DEFRAG_CONNTRACK_BRIDGE_IN, |
362 | __IP6_DEFRAG_CONNTRACK_BRIDGE_IN = IP6_DEFRAG_CONNTRACK_BRIDGE_IN + USHORT_MAX, | ||
358 | }; | 363 | }; |
359 | 364 | ||
360 | struct ip6_create_arg { | 365 | struct ip6_create_arg { |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index f307e133d14c..82b7be4db89a 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -81,6 +81,8 @@ struct net { | |||
81 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 81 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
82 | struct netns_ct ct; | 82 | struct netns_ct ct; |
83 | #endif | 83 | #endif |
84 | struct sock *nfnl; | ||
85 | struct sock *nfnl_stash; | ||
84 | #endif | 86 | #endif |
85 | #ifdef CONFIG_XFRM | 87 | #ifdef CONFIG_XFRM |
86 | struct netns_xfrm xfrm; | 88 | struct netns_xfrm xfrm; |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index a0904adfb8f7..bde095f7e845 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -70,7 +70,7 @@ union nf_conntrack_help { | |||
70 | struct nf_conntrack_helper; | 70 | struct nf_conntrack_helper; |
71 | 71 | ||
72 | /* Must be kept in sync with the classes defined by helpers */ | 72 | /* Must be kept in sync with the classes defined by helpers */ |
73 | #define NF_CT_MAX_EXPECT_CLASSES 3 | 73 | #define NF_CT_MAX_EXPECT_CLASSES 4 |
74 | 74 | ||
75 | /* nf_conn feature for connections that have a helper */ | 75 | /* nf_conn feature for connections that have a helper */ |
76 | struct nf_conn_help { | 76 | struct nf_conn_help { |
@@ -198,7 +198,8 @@ extern void *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced, int null | |||
198 | extern void nf_ct_free_hashtable(void *hash, int vmalloced, unsigned int size); | 198 | extern void nf_ct_free_hashtable(void *hash, int vmalloced, unsigned int size); |
199 | 199 | ||
200 | extern struct nf_conntrack_tuple_hash * | 200 | extern struct nf_conntrack_tuple_hash * |
201 | __nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple); | 201 | __nf_conntrack_find(struct net *net, u16 zone, |
202 | const struct nf_conntrack_tuple *tuple); | ||
202 | 203 | ||
203 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); | 204 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); |
204 | extern void nf_ct_delete_from_lists(struct nf_conn *ct); | 205 | extern void nf_ct_delete_from_lists(struct nf_conn *ct); |
@@ -267,11 +268,16 @@ extern void | |||
267 | nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); | 268 | nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); |
268 | extern void nf_conntrack_free(struct nf_conn *ct); | 269 | extern void nf_conntrack_free(struct nf_conn *ct); |
269 | extern struct nf_conn * | 270 | extern struct nf_conn * |
270 | nf_conntrack_alloc(struct net *net, | 271 | nf_conntrack_alloc(struct net *net, u16 zone, |
271 | const struct nf_conntrack_tuple *orig, | 272 | const struct nf_conntrack_tuple *orig, |
272 | const struct nf_conntrack_tuple *repl, | 273 | const struct nf_conntrack_tuple *repl, |
273 | gfp_t gfp); | 274 | gfp_t gfp); |
274 | 275 | ||
276 | static inline int nf_ct_is_template(const struct nf_conn *ct) | ||
277 | { | ||
278 | return test_bit(IPS_TEMPLATE_BIT, &ct->status); | ||
279 | } | ||
280 | |||
275 | /* It's confirmed if it is, or has been in the hash table. */ | 281 | /* It's confirmed if it is, or has been in the hash table. */ |
276 | static inline int nf_ct_is_confirmed(struct nf_conn *ct) | 282 | static inline int nf_ct_is_confirmed(struct nf_conn *ct) |
277 | { | 283 | { |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index 5a449b44ba33..dffde8e6920e 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -49,7 +49,8 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, | |||
49 | 49 | ||
50 | /* Find a connection corresponding to a tuple. */ | 50 | /* Find a connection corresponding to a tuple. */ |
51 | extern struct nf_conntrack_tuple_hash * | 51 | extern struct nf_conntrack_tuple_hash * |
52 | nf_conntrack_find_get(struct net *net, const struct nf_conntrack_tuple *tuple); | 52 | nf_conntrack_find_get(struct net *net, u16 zone, |
53 | const struct nf_conntrack_tuple *tuple); | ||
53 | 54 | ||
54 | extern int __nf_conntrack_confirm(struct sk_buff *skb); | 55 | extern int __nf_conntrack_confirm(struct sk_buff *skb); |
55 | 56 | ||
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 475facc3051a..96ba5f7dcab6 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -12,27 +12,12 @@ | |||
12 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | 12 | #include <linux/netfilter/nf_conntrack_tuple_common.h> |
13 | #include <net/netfilter/nf_conntrack_extend.h> | 13 | #include <net/netfilter/nf_conntrack_extend.h> |
14 | 14 | ||
15 | /* Connection tracking event types */ | ||
16 | enum ip_conntrack_events { | ||
17 | IPCT_NEW = 0, /* new conntrack */ | ||
18 | IPCT_RELATED = 1, /* related conntrack */ | ||
19 | IPCT_DESTROY = 2, /* destroyed conntrack */ | ||
20 | IPCT_STATUS = 3, /* status has changed */ | ||
21 | IPCT_PROTOINFO = 4, /* protocol information has changed */ | ||
22 | IPCT_HELPER = 5, /* new helper has been set */ | ||
23 | IPCT_MARK = 6, /* new mark has been set */ | ||
24 | IPCT_NATSEQADJ = 7, /* NAT is doing sequence adjustment */ | ||
25 | IPCT_SECMARK = 8, /* new security mark has been set */ | ||
26 | }; | ||
27 | |||
28 | enum ip_conntrack_expect_events { | ||
29 | IPEXP_NEW = 0, /* new expectation */ | ||
30 | }; | ||
31 | |||
32 | struct nf_conntrack_ecache { | 15 | struct nf_conntrack_ecache { |
33 | unsigned long cache; /* bitops want long */ | 16 | unsigned long cache; /* bitops want long */ |
34 | unsigned long missed; /* missed events */ | 17 | unsigned long missed; /* missed events */ |
35 | u32 pid; /* netlink pid of destroyer */ | 18 | u16 ctmask; /* bitmask of ct events to be delivered */ |
19 | u16 expmask; /* bitmask of expect events to be delivered */ | ||
20 | u32 pid; /* netlink pid of destroyer */ | ||
36 | }; | 21 | }; |
37 | 22 | ||
38 | static inline struct nf_conntrack_ecache * | 23 | static inline struct nf_conntrack_ecache * |
@@ -42,14 +27,24 @@ nf_ct_ecache_find(const struct nf_conn *ct) | |||
42 | } | 27 | } |
43 | 28 | ||
44 | static inline struct nf_conntrack_ecache * | 29 | static inline struct nf_conntrack_ecache * |
45 | nf_ct_ecache_ext_add(struct nf_conn *ct, gfp_t gfp) | 30 | nf_ct_ecache_ext_add(struct nf_conn *ct, u16 ctmask, u16 expmask, gfp_t gfp) |
46 | { | 31 | { |
47 | struct net *net = nf_ct_net(ct); | 32 | struct net *net = nf_ct_net(ct); |
33 | struct nf_conntrack_ecache *e; | ||
48 | 34 | ||
49 | if (!net->ct.sysctl_events) | 35 | if (!ctmask && !expmask && net->ct.sysctl_events) { |
36 | ctmask = ~0; | ||
37 | expmask = ~0; | ||
38 | } | ||
39 | if (!ctmask && !expmask) | ||
50 | return NULL; | 40 | return NULL; |
51 | 41 | ||
52 | return nf_ct_ext_add(ct, NF_CT_EXT_ECACHE, gfp); | 42 | e = nf_ct_ext_add(ct, NF_CT_EXT_ECACHE, gfp); |
43 | if (e) { | ||
44 | e->ctmask = ctmask; | ||
45 | e->expmask = expmask; | ||
46 | } | ||
47 | return e; | ||
53 | }; | 48 | }; |
54 | 49 | ||
55 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | 50 | #ifdef CONFIG_NF_CONNTRACK_EVENTS |
@@ -82,6 +77,9 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | |||
82 | if (e == NULL) | 77 | if (e == NULL) |
83 | return; | 78 | return; |
84 | 79 | ||
80 | if (!(e->ctmask & (1 << event))) | ||
81 | return; | ||
82 | |||
85 | set_bit(event, &e->cache); | 83 | set_bit(event, &e->cache); |
86 | } | 84 | } |
87 | 85 | ||
@@ -92,7 +90,6 @@ nf_conntrack_eventmask_report(unsigned int eventmask, | |||
92 | int report) | 90 | int report) |
93 | { | 91 | { |
94 | int ret = 0; | 92 | int ret = 0; |
95 | struct net *net = nf_ct_net(ct); | ||
96 | struct nf_ct_event_notifier *notify; | 93 | struct nf_ct_event_notifier *notify; |
97 | struct nf_conntrack_ecache *e; | 94 | struct nf_conntrack_ecache *e; |
98 | 95 | ||
@@ -101,9 +98,6 @@ nf_conntrack_eventmask_report(unsigned int eventmask, | |||
101 | if (notify == NULL) | 98 | if (notify == NULL) |
102 | goto out_unlock; | 99 | goto out_unlock; |
103 | 100 | ||
104 | if (!net->ct.sysctl_events) | ||
105 | goto out_unlock; | ||
106 | |||
107 | e = nf_ct_ecache_find(ct); | 101 | e = nf_ct_ecache_find(ct); |
108 | if (e == NULL) | 102 | if (e == NULL) |
109 | goto out_unlock; | 103 | goto out_unlock; |
@@ -117,6 +111,9 @@ nf_conntrack_eventmask_report(unsigned int eventmask, | |||
117 | /* This is a resent of a destroy event? If so, skip missed */ | 111 | /* This is a resent of a destroy event? If so, skip missed */ |
118 | unsigned long missed = e->pid ? 0 : e->missed; | 112 | unsigned long missed = e->pid ? 0 : e->missed; |
119 | 113 | ||
114 | if (!((eventmask | missed) & e->ctmask)) | ||
115 | goto out_unlock; | ||
116 | |||
120 | ret = notify->fcn(eventmask | missed, &item); | 117 | ret = notify->fcn(eventmask | missed, &item); |
121 | if (unlikely(ret < 0 || missed)) { | 118 | if (unlikely(ret < 0 || missed)) { |
122 | spin_lock_bh(&ct->lock); | 119 | spin_lock_bh(&ct->lock); |
@@ -172,18 +169,19 @@ nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | |||
172 | u32 pid, | 169 | u32 pid, |
173 | int report) | 170 | int report) |
174 | { | 171 | { |
175 | struct net *net = nf_ct_exp_net(exp); | ||
176 | struct nf_exp_event_notifier *notify; | 172 | struct nf_exp_event_notifier *notify; |
173 | struct nf_conntrack_ecache *e; | ||
177 | 174 | ||
178 | rcu_read_lock(); | 175 | rcu_read_lock(); |
179 | notify = rcu_dereference(nf_expect_event_cb); | 176 | notify = rcu_dereference(nf_expect_event_cb); |
180 | if (notify == NULL) | 177 | if (notify == NULL) |
181 | goto out_unlock; | 178 | goto out_unlock; |
182 | 179 | ||
183 | if (!net->ct.sysctl_events) | 180 | e = nf_ct_ecache_find(exp->master); |
181 | if (e == NULL) | ||
184 | goto out_unlock; | 182 | goto out_unlock; |
185 | 183 | ||
186 | { | 184 | if (e->expmask & (1 << event)) { |
187 | struct nf_exp_event item = { | 185 | struct nf_exp_event item = { |
188 | .exp = exp, | 186 | .exp = exp, |
189 | .pid = pid, | 187 | .pid = pid, |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 9a2b9cb52271..11e815084fcf 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -56,16 +56,13 @@ struct nf_conntrack_expect { | |||
56 | 56 | ||
57 | static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp) | 57 | static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp) |
58 | { | 58 | { |
59 | #ifdef CONFIG_NET_NS | 59 | return nf_ct_net(exp->master); |
60 | return exp->master->ct_net; /* by definition */ | ||
61 | #else | ||
62 | return &init_net; | ||
63 | #endif | ||
64 | } | 60 | } |
65 | 61 | ||
66 | struct nf_conntrack_expect_policy { | 62 | struct nf_conntrack_expect_policy { |
67 | unsigned int max_expected; | 63 | unsigned int max_expected; |
68 | unsigned int timeout; | 64 | unsigned int timeout; |
65 | const char *name; | ||
69 | }; | 66 | }; |
70 | 67 | ||
71 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 | 68 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 |
@@ -77,13 +74,16 @@ int nf_conntrack_expect_init(struct net *net); | |||
77 | void nf_conntrack_expect_fini(struct net *net); | 74 | void nf_conntrack_expect_fini(struct net *net); |
78 | 75 | ||
79 | struct nf_conntrack_expect * | 76 | struct nf_conntrack_expect * |
80 | __nf_ct_expect_find(struct net *net, const struct nf_conntrack_tuple *tuple); | 77 | __nf_ct_expect_find(struct net *net, u16 zone, |
78 | const struct nf_conntrack_tuple *tuple); | ||
81 | 79 | ||
82 | struct nf_conntrack_expect * | 80 | struct nf_conntrack_expect * |
83 | nf_ct_expect_find_get(struct net *net, const struct nf_conntrack_tuple *tuple); | 81 | nf_ct_expect_find_get(struct net *net, u16 zone, |
82 | const struct nf_conntrack_tuple *tuple); | ||
84 | 83 | ||
85 | struct nf_conntrack_expect * | 84 | struct nf_conntrack_expect * |
86 | nf_ct_find_expectation(struct net *net, const struct nf_conntrack_tuple *tuple); | 85 | nf_ct_find_expectation(struct net *net, u16 zone, |
86 | const struct nf_conntrack_tuple *tuple); | ||
87 | 87 | ||
88 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); | 88 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); |
89 | void nf_ct_remove_expectations(struct nf_conn *ct); | 89 | void nf_ct_remove_expectations(struct nf_conn *ct); |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index e192dc17c583..2d2a1f9a61d8 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -8,6 +8,7 @@ enum nf_ct_ext_id { | |||
8 | NF_CT_EXT_NAT, | 8 | NF_CT_EXT_NAT, |
9 | NF_CT_EXT_ACCT, | 9 | NF_CT_EXT_ACCT, |
10 | NF_CT_EXT_ECACHE, | 10 | NF_CT_EXT_ECACHE, |
11 | NF_CT_EXT_ZONE, | ||
11 | NF_CT_EXT_NUM, | 12 | NF_CT_EXT_NUM, |
12 | }; | 13 | }; |
13 | 14 | ||
@@ -15,6 +16,7 @@ enum nf_ct_ext_id { | |||
15 | #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat | 16 | #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat |
16 | #define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter | 17 | #define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter |
17 | #define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache | 18 | #define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache |
19 | #define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone | ||
18 | 20 | ||
19 | /* Extensions: optional stuff which isn't permanently in struct. */ | 21 | /* Extensions: optional stuff which isn't permanently in struct. */ |
20 | struct nf_ct_ext { | 22 | struct nf_ct_ext { |
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index d015de92e03f..32c305dbdab6 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -40,14 +40,18 @@ struct nf_conntrack_helper { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | extern struct nf_conntrack_helper * | 42 | extern struct nf_conntrack_helper * |
43 | __nf_conntrack_helper_find_byname(const char *name); | 43 | __nf_conntrack_helper_find(const char *name, u16 l3num, u8 protonum); |
44 | |||
45 | extern struct nf_conntrack_helper * | ||
46 | nf_conntrack_helper_try_module_get(const char *name, u16 l3num, u8 protonum); | ||
44 | 47 | ||
45 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | 48 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); |
46 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | 49 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); |
47 | 50 | ||
48 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); | 51 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); |
49 | 52 | ||
50 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, gfp_t flags); | 53 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, |
54 | gfp_t flags); | ||
51 | 55 | ||
52 | extern void nf_ct_helper_destroy(struct nf_conn *ct); | 56 | extern void nf_ct_helper_destroy(struct nf_conn *ct); |
53 | 57 | ||
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index ca6dcf3445ab..e3d3ee3c06a2 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -49,8 +49,8 @@ struct nf_conntrack_l4proto { | |||
49 | /* Called when a conntrack entry is destroyed */ | 49 | /* Called when a conntrack entry is destroyed */ |
50 | void (*destroy)(struct nf_conn *ct); | 50 | void (*destroy)(struct nf_conn *ct); |
51 | 51 | ||
52 | int (*error)(struct net *net, struct sk_buff *skb, unsigned int dataoff, | 52 | int (*error)(struct net *net, struct nf_conn *tmpl, struct sk_buff *skb, |
53 | enum ip_conntrack_info *ctinfo, | 53 | unsigned int dataoff, enum ip_conntrack_info *ctinfo, |
54 | u_int8_t pf, unsigned int hooknum); | 54 | u_int8_t pf, unsigned int hooknum); |
55 | 55 | ||
56 | /* Print out the per-protocol part of the tuple. Return like seq_* */ | 56 | /* Print out the per-protocol part of the tuple. Return like seq_* */ |
diff --git a/include/net/netfilter/nf_conntrack_zones.h b/include/net/netfilter/nf_conntrack_zones.h new file mode 100644 index 000000000000..0bbb2bd51e89 --- /dev/null +++ b/include/net/netfilter/nf_conntrack_zones.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _NF_CONNTRACK_ZONES_H | ||
2 | #define _NF_CONNTRACK_ZONES_H | ||
3 | |||
4 | #include <net/netfilter/nf_conntrack_extend.h> | ||
5 | |||
6 | #define NF_CT_DEFAULT_ZONE 0 | ||
7 | |||
8 | struct nf_conntrack_zone { | ||
9 | u16 id; | ||
10 | }; | ||
11 | |||
12 | static inline u16 nf_ct_zone(const struct nf_conn *ct) | ||
13 | { | ||
14 | #ifdef CONFIG_NF_CONNTRACK_ZONES | ||
15 | struct nf_conntrack_zone *nf_ct_zone; | ||
16 | nf_ct_zone = nf_ct_ext_find(ct, NF_CT_EXT_ZONE); | ||
17 | if (nf_ct_zone) | ||
18 | return nf_ct_zone->id; | ||
19 | #endif | ||
20 | return NF_CT_DEFAULT_ZONE; | ||
21 | } | ||
22 | |||
23 | #endif /* _NF_CONNTRACK_ZONES_H */ | ||
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h index 4222220920a5..02bb6c29dc3d 100644 --- a/include/net/netfilter/nf_nat_helper.h +++ b/include/net/netfilter/nf_nat_helper.h | |||
@@ -7,13 +7,27 @@ | |||
7 | struct sk_buff; | 7 | struct sk_buff; |
8 | 8 | ||
9 | /* These return true or false. */ | 9 | /* These return true or false. */ |
10 | extern int nf_nat_mangle_tcp_packet(struct sk_buff *skb, | 10 | extern int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, |
11 | struct nf_conn *ct, | 11 | struct nf_conn *ct, |
12 | enum ip_conntrack_info ctinfo, | 12 | enum ip_conntrack_info ctinfo, |
13 | unsigned int match_offset, | 13 | unsigned int match_offset, |
14 | unsigned int match_len, | 14 | unsigned int match_len, |
15 | const char *rep_buffer, | 15 | const char *rep_buffer, |
16 | unsigned int rep_len); | 16 | unsigned int rep_len, bool adjust); |
17 | |||
18 | static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, | ||
19 | struct nf_conn *ct, | ||
20 | enum ip_conntrack_info ctinfo, | ||
21 | unsigned int match_offset, | ||
22 | unsigned int match_len, | ||
23 | const char *rep_buffer, | ||
24 | unsigned int rep_len) | ||
25 | { | ||
26 | return __nf_nat_mangle_tcp_packet(skb, ct, ctinfo, | ||
27 | match_offset, match_len, | ||
28 | rep_buffer, rep_len, true); | ||
29 | } | ||
30 | |||
17 | extern int nf_nat_mangle_udp_packet(struct sk_buff *skb, | 31 | extern int nf_nat_mangle_udp_packet(struct sk_buff *skb, |
18 | struct nf_conn *ct, | 32 | struct nf_conn *ct, |
19 | enum ip_conntrack_info ctinfo, | 33 | enum ip_conntrack_info ctinfo, |
@@ -21,6 +35,10 @@ extern int nf_nat_mangle_udp_packet(struct sk_buff *skb, | |||
21 | unsigned int match_len, | 35 | unsigned int match_len, |
22 | const char *rep_buffer, | 36 | const char *rep_buffer, |
23 | unsigned int rep_len); | 37 | unsigned int rep_len); |
38 | |||
39 | extern void nf_nat_set_seq_adjust(struct nf_conn *ct, | ||
40 | enum ip_conntrack_info ctinfo, | ||
41 | __be32 seq, s16 off); | ||
24 | extern int nf_nat_seq_adjust(struct sk_buff *skb, | 42 | extern int nf_nat_seq_adjust(struct sk_buff *skb, |
25 | struct nf_conn *ct, | 43 | struct nf_conn *ct, |
26 | enum ip_conntrack_info ctinfo); | 44 | enum ip_conntrack_info ctinfo); |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 9a4b8b714079..2764994c9136 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -37,7 +37,9 @@ struct netns_ipv4 { | |||
37 | struct xt_table *iptable_mangle; | 37 | struct xt_table *iptable_mangle; |
38 | struct xt_table *iptable_raw; | 38 | struct xt_table *iptable_raw; |
39 | struct xt_table *arptable_filter; | 39 | struct xt_table *arptable_filter; |
40 | #ifdef CONFIG_SECURITY | ||
40 | struct xt_table *iptable_security; | 41 | struct xt_table *iptable_security; |
42 | #endif | ||
41 | struct xt_table *nat_table; | 43 | struct xt_table *nat_table; |
42 | struct hlist_head *nat_bysource; | 44 | struct hlist_head *nat_bysource; |
43 | unsigned int nat_htable_size; | 45 | unsigned int nat_htable_size; |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index dfeb2d7c425b..1f11ebc22151 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -36,8 +36,10 @@ struct netns_ipv6 { | |||
36 | struct xt_table *ip6table_filter; | 36 | struct xt_table *ip6table_filter; |
37 | struct xt_table *ip6table_mangle; | 37 | struct xt_table *ip6table_mangle; |
38 | struct xt_table *ip6table_raw; | 38 | struct xt_table *ip6table_raw; |
39 | #ifdef CONFIG_SECURITY | ||
39 | struct xt_table *ip6table_security; | 40 | struct xt_table *ip6table_security; |
40 | #endif | 41 | #endif |
42 | #endif | ||
41 | struct rt6_info *ip6_null_entry; | 43 | struct rt6_info *ip6_null_entry; |
42 | struct rt6_statistics *rt6_stats; | 44 | struct rt6_statistics *rt6_stats; |
43 | struct timer_list ip6_fib_timer; | 45 | struct timer_list ip6_fib_timer; |