aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/networking/tproxy.txt5
-rw-r--r--include/linux/netfilter.h8
-rw-r--r--include/net/netfilter/nf_conntrack.h9
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h7
-rw-r--r--include/net/netfilter/nf_nat.h2
-rw-r--r--include/net/netfilter/nf_nat_helper.h6
-rw-r--r--include/net/netfilter/nf_tproxy_core.h210
-rw-r--r--include/net/netfilter/nfnetlink_queue.h8
-rw-r--r--include/uapi/linux/netfilter/Kbuild2
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_queue.h1
-rw-r--r--include/uapi/linux/netfilter/xt_HMARK.h (renamed from include/linux/netfilter/xt_HMARK.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_rpfilter.h (renamed from include/linux/netfilter/xt_rpfilter.h)0
-rw-r--r--net/ipv4/netfilter/ipt_MASQUERADE.c2
-rw-r--r--net/ipv6/netfilter/ip6t_MASQUERADE.c2
-rw-r--r--net/netfilter/Kconfig22
-rw-r--r--net/netfilter/Makefile3
-rw-r--r--net/netfilter/core.c7
-rw-r--r--net/netfilter/ipvs/ip_vs_lblcr.c8
-rw-r--r--net/netfilter/ipvs/ip_vs_sh.c6
-rw-r--r--net/netfilter/nf_conntrack_core.c69
-rw-r--r--net/netfilter/nf_conntrack_labels.c4
-rw-r--r--net/netfilter/nf_conntrack_netlink.c269
-rw-r--r--net/netfilter/nf_conntrack_proto.c4
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c4
-rw-r--r--net/netfilter/nf_nat_core.c6
-rw-r--r--net/netfilter/nf_nat_helper.c28
-rw-r--r--net/netfilter/nf_tproxy_core.c62
-rw-r--r--net/netfilter/nfnetlink_queue_core.c11
-rw-r--r--net/netfilter/nfnetlink_queue_ct.c15
-rw-r--r--net/netfilter/xt_TPROXY.c169
-rw-r--r--net/netfilter/xt_addrtype.c2
-rw-r--r--net/netfilter/xt_socket.c66
32 files changed, 513 insertions, 504 deletions
diff --git a/Documentation/networking/tproxy.txt b/Documentation/networking/tproxy.txt
index 7b5996d9357e..ec11429e1d42 100644
--- a/Documentation/networking/tproxy.txt
+++ b/Documentation/networking/tproxy.txt
@@ -2,9 +2,8 @@ Transparent proxy support
2========================= 2=========================
3 3
4This feature adds Linux 2.2-like transparent proxy support to current kernels. 4This feature adds Linux 2.2-like transparent proxy support to current kernels.
5To use it, enable NETFILTER_TPROXY, the socket match and the TPROXY target in 5To use it, enable the socket match and the TPROXY target in your kernel config.
6your kernel config. You will need policy routing too, so be sure to enable that 6You will need policy routing too, so be sure to enable that as well.
7as well.
8 7
9 8
101. Making non-local sockets work 91. Making non-local sockets work
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index de70f7b45b68..e2cf786be22f 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -314,8 +314,8 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
314#endif /*CONFIG_NETFILTER*/ 314#endif /*CONFIG_NETFILTER*/
315 315
316#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 316#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
317extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; 317extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu;
318extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); 318extern 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;
@@ -325,12 +325,14 @@ struct nfq_ct_hook {
325 size_t (*build_size)(const struct nf_conn *ct); 325 size_t (*build_size)(const struct nf_conn *ct);
326 int (*build)(struct sk_buff *skb, struct nf_conn *ct); 326 int (*build)(struct sk_buff *skb, struct nf_conn *ct);
327 int (*parse)(const struct nlattr *attr, struct nf_conn *ct); 327 int (*parse)(const struct nlattr *attr, struct nf_conn *ct);
328 int (*attach_expect)(const struct nlattr *attr, struct nf_conn *ct,
329 u32 portid, u32 report);
328}; 330};
329extern struct nfq_ct_hook __rcu *nfq_ct_hook; 331extern struct nfq_ct_hook __rcu *nfq_ct_hook;
330 332
331struct nfq_ct_nat_hook { 333struct nfq_ct_nat_hook {
332 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct, 334 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct,
333 u32 ctinfo, int off); 335 u32 ctinfo, s32 off);
334}; 336};
335extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook; 337extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook;
336#else 338#else
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 644d9c223d24..0c1288a50e8b 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -181,8 +181,7 @@ __nf_conntrack_find(struct net *net, u16 zone,
181 const struct nf_conntrack_tuple *tuple); 181 const struct nf_conntrack_tuple *tuple);
182 182
183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); 183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct);
184extern void nf_ct_delete_from_lists(struct nf_conn *ct); 184bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report);
185extern void nf_ct_dying_timeout(struct nf_conn *ct);
186 185
187extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report); 186extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report);
188 187
@@ -235,7 +234,7 @@ static inline bool nf_ct_kill(struct nf_conn *ct)
235} 234}
236 235
237/* These are for NAT. Icky. */ 236/* These are for NAT. Icky. */
238extern s16 (*nf_ct_nat_offset)(const struct nf_conn *ct, 237extern s32 (*nf_ct_nat_offset)(const struct nf_conn *ct,
239 enum ip_conntrack_dir dir, 238 enum ip_conntrack_dir dir,
240 u32 seq); 239 u32 seq);
241 240
@@ -249,7 +248,9 @@ extern void nf_ct_untracked_status_or(unsigned long bits);
249 248
250/* Iterate over all conntracks: if iter returns true, it's deleted. */ 249/* Iterate over all conntracks: if iter returns true, it's deleted. */
251extern void 250extern void
252nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); 251nf_ct_iterate_cleanup(struct net *net,
252 int (*iter)(struct nf_conn *i, void *data),
253 void *data, u32 portid, int report);
253extern void nf_conntrack_free(struct nf_conn *ct); 254extern void nf_conntrack_free(struct nf_conn *ct);
254extern struct nf_conn * 255extern struct nf_conn *
255nf_conntrack_alloc(struct net *net, u16 zone, 256nf_conntrack_alloc(struct net *net, u16 zone,
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index 914d8d900798..b411d7b17dec 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -148,17 +148,10 @@ extern int nf_ct_port_nlattr_tuple_size(void);
148extern const struct nla_policy nf_ct_port_nla_policy[]; 148extern const struct nla_policy nf_ct_port_nla_policy[];
149 149
150#ifdef CONFIG_SYSCTL 150#ifdef CONFIG_SYSCTL
151#ifdef DEBUG_INVALID_PACKETS
152#define LOG_INVALID(net, proto) \ 151#define LOG_INVALID(net, proto) \
153 ((net)->ct.sysctl_log_invalid == (proto) || \ 152 ((net)->ct.sysctl_log_invalid == (proto) || \
154 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) 153 (net)->ct.sysctl_log_invalid == IPPROTO_RAW)
155#else 154#else
156#define LOG_INVALID(net, proto) \
157 (((net)->ct.sysctl_log_invalid == (proto) || \
158 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) \
159 && net_ratelimit())
160#endif
161#else
162static inline int LOG_INVALID(struct net *net, int proto) { return 0; } 155static inline int LOG_INVALID(struct net *net, int proto) { return 0; }
163#endif /* CONFIG_SYSCTL */ 156#endif /* CONFIG_SYSCTL */
164 157
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index ad14a799fd2e..e2441413675c 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -19,7 +19,7 @@ struct nf_nat_seq {
19 u_int32_t correction_pos; 19 u_int32_t correction_pos;
20 20
21 /* sequence number offset before and after last modification */ 21 /* sequence number offset before and after last modification */
22 int16_t offset_before, offset_after; 22 int32_t offset_before, offset_after;
23}; 23};
24 24
25#include <linux/list.h> 25#include <linux/list.h>
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index b4d6bfc2af03..194c34794923 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -41,7 +41,7 @@ extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
41 41
42extern void nf_nat_set_seq_adjust(struct nf_conn *ct, 42extern void nf_nat_set_seq_adjust(struct nf_conn *ct,
43 enum ip_conntrack_info ctinfo, 43 enum ip_conntrack_info ctinfo,
44 __be32 seq, s16 off); 44 __be32 seq, s32 off);
45extern int nf_nat_seq_adjust(struct sk_buff *skb, 45extern int nf_nat_seq_adjust(struct sk_buff *skb,
46 struct nf_conn *ct, 46 struct nf_conn *ct,