aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorBalazs Scheidler <bazsi@balabit.hu>2010-10-21 06:45:14 -0400
committerPatrick McHardy <kaber@trash.net>2010-10-21 06:45:14 -0400
commit106e4c26b1529e559d1aae777f11b4f8f7bafc26 (patch)
treee784c61379e767255bf941f9d78d9ef6e7c58640 /include/net
parentd86bef73b4a24e59e7c1f896a72bbf38430ac2c6 (diff)
tproxy: kick out TIME_WAIT sockets in case a new connection comes in with the same tuple
Without tproxy redirections an incoming SYN kicks out conflicting TIME_WAIT sockets, in order to handle clients that reuse ports within the TIME_WAIT period. The same mechanism didn't work in case TProxy is involved in finding the proper socket, as the time_wait processing code looked up the listening socket assuming that the listener addr/port matches those of the established connection. This is not the case with TProxy as the listener addr/port is possibly changed with the tproxy rule. Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> Signed-off-by: KOVACS Krisztian <hidden@balabit.hu> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/nf_tproxy_core.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h
index 208b46f4d6d2..b3a8942a4e6a 100644
--- a/include/net/netfilter/nf_tproxy_core.h
+++ b/include/net/netfilter/nf_tproxy_core.h
@@ -8,12 +8,16 @@
8#include <net/inet_sock.h> 8#include <net/inet_sock.h>
9#include <net/tcp.h> 9#include <net/tcp.h>
10 10
11#define NFT_LOOKUP_ANY 0
12#define NFT_LOOKUP_LISTENER 1
13#define NFT_LOOKUP_ESTABLISHED 2
14
11/* look up and get a reference to a matching socket */ 15/* look up and get a reference to a matching socket */
12extern struct sock * 16extern struct sock *
13nf_tproxy_get_sock_v4(struct net *net, const u8 protocol, 17nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
14 const __be32 saddr, const __be32 daddr, 18 const __be32 saddr, const __be32 daddr,
15 const __be16 sport, const __be16 dport, 19 const __be16 sport, const __be16 dport,
16 const struct net_device *in, bool listening); 20 const struct net_device *in, int lookup_type);
17 21
18static inline void 22static inline void
19nf_tproxy_put_sock(struct sock *sk) 23nf_tproxy_put_sock(struct sock *sk)