diff options
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 | ||
| 4 | This feature adds Linux 2.2-like transparent proxy support to current kernels. | 4 | This feature adds Linux 2.2-like transparent proxy support to current kernels. |
| 5 | To use it, enable NETFILTER_TPROXY, the socket match and the TPROXY target in | 5 | To use it, enable the socket match and the TPROXY target in your kernel config. |
| 6 | your kernel config. You will need policy routing too, so be sure to enable that | 6 | You will need policy routing too, so be sure to enable that as well. |
| 7 | as well. | ||
| 8 | 7 | ||
| 9 | 8 | ||
| 10 | 1. Making non-local sockets work | 9 | 1. 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) |
| 317 | extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; | 317 | extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu; |
| 318 | extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); | 318 | extern void nf_ct_attach(struct sk_buff *, const struct sk_buff *); |
| 319 | extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; | 319 | extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; |
| 320 | 320 | ||
| 321 | struct nf_conn; | 321 | struct 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 | }; |
| 329 | extern struct nfq_ct_hook __rcu *nfq_ct_hook; | 331 | extern struct nfq_ct_hook __rcu *nfq_ct_hook; |
| 330 | 332 | ||
| 331 | struct nfq_ct_nat_hook { | 333 | struct 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 | }; |
| 335 | extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook; | 337 | extern 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 | ||
| 183 | extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); | 183 | extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); |
| 184 | extern void nf_ct_delete_from_lists(struct nf_conn *ct); | 184 | bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report); |
| 185 | extern void nf_ct_dying_timeout(struct nf_conn *ct); | ||
| 186 | 185 | ||
| 187 | extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report); | 186 | extern 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. */ |
| 238 | extern s16 (*nf_ct_nat_offset)(const struct nf_conn *ct, | 237 | extern 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. */ |
| 251 | extern void | 250 | extern void |
| 252 | nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); | 251 | nf_ct_iterate_cleanup(struct net *net, |
| 252 | int (*iter)(struct nf_conn *i, void *data), | ||
| 253 | void *data, u32 portid, int report); | ||
| 253 | extern void nf_conntrack_free(struct nf_conn *ct); | 254 | extern void nf_conntrack_free(struct nf_conn *ct); |
| 254 | extern struct nf_conn * | 255 | extern struct nf_conn * |
| 255 | nf_conntrack_alloc(struct net *net, u16 zone, | 256 | nf_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); | |||
| 148 | extern const struct nla_policy nf_ct_port_nla_policy[]; | 148 | extern 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 | ||
| 162 | static inline int LOG_INVALID(struct net *net, int proto) { return 0; } | 155 | static 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 | ||
| 42 | extern void nf_nat_set_seq_adjust(struct nf_conn *ct, | 42 | extern 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); |
| 45 | extern int nf_nat_seq_adjust(struct sk_buff *skb, | 45 | extern int nf_nat_seq_adjust(struct sk_buff *skb, |
| 46 | struct nf_conn *ct, | 46 | struct nf_conn *ct, |
