aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2013-08-27 02:50:12 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2013-08-27 18:26:48 -0400
commit41d73ec053d2424599c4ed8452b889374d523ade (patch)
tree404e0418e7f4c06cd37065eee97f67f6123df160 /include/linux
parent706f5151e349a3d8ab85237d0d6c553930376e9f (diff)
netfilter: nf_conntrack: make sequence number adjustments usuable without NAT
Split out sequence number adjustments from NAT and move them to the conntrack core to make them usable for SYN proxying. The sequence number adjustment information is moved to a seperate extend. The extend is added to new conntracks when a NAT mapping is set up for a connection using a helper. As a side effect, this saves 24 bytes per connection with NAT in the common case that a connection does not have a helper assigned. Signed-off-by: Patrick McHardy <kaber@trash.net> Tested-by: Martin Topholm <mph@one.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netfilter.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index e2cf786be22f..708fe72ab913 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -319,6 +319,7 @@ extern void nf_ct_attach(struct sk_buff *, const struct sk_buff *);
319extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; 319extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
320 320
321struct nf_conn; 321struct nf_conn;
322enum ip_conntrack_info;
322struct nlattr; 323struct nlattr;
323 324
324struct nfq_ct_hook { 325struct nfq_ct_hook {
@@ -327,14 +328,10 @@ struct nfq_ct_hook {
327 int (*parse)(const struct nlattr *attr, struct nf_conn *ct); 328 int (*parse)(const struct nlattr *attr, struct nf_conn *ct);
328 int (*attach_expect)(const struct nlattr *attr, struct nf_conn *ct, 329 int (*attach_expect)(const struct nlattr *attr, struct nf_conn *ct,
329 u32 portid, u32 report); 330 u32 portid, u32 report);
330};
331extern struct nfq_ct_hook __rcu *nfq_ct_hook;
332
333struct nfq_ct_nat_hook {
334 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct, 331 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct,
335 u32 ctinfo, s32 off); 332 enum ip_conntrack_info ctinfo, s32 off);
336}; 333};
337extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook; 334extern struct nfq_ct_hook __rcu *nfq_ct_hook;
338#else 335#else
339static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} 336static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
340#endif 337#endif