diff options
author | Dong Wei <dwei.zh@gmail.com> | 2008-06-04 09:57:51 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-04 09:57:51 -0700 |
commit | d2ee3f2c4b1db1320c1efb4dcaceeaf6c7e6c2d3 (patch) | |
tree | 081c903c68a0df98f0ac1f3a73f480d801af0689 /net/netfilter | |
parent | ab32cd793dca21eec846a8204390d9594ed994d5 (diff) | |
download | kernel_samsung_tuna-d2ee3f2c4b1db1320c1efb4dcaceeaf6c7e6c2d3.zip kernel_samsung_tuna-d2ee3f2c4b1db1320c1efb4dcaceeaf6c7e6c2d3.tar.gz kernel_samsung_tuna-d2ee3f2c4b1db1320c1efb4dcaceeaf6c7e6c2d3.tar.bz2 |
netfilter: xt_connlimit: fix accouning when receive RST packet in ESTABLISHED state
In xt_connlimit match module, the counter of an IP is decreased when
the TCP packet is go through the chain with ip_conntrack state TW.
Well, it's very natural that the server and client close the socket
with FIN packet. But when the client/server close the socket with RST
packet(using so_linger), the counter for this connection still exsit.
The following patch can fix it which is based on linux-2.6.25.4
Signed-off-by: Dong Wei <dwei.zh@gmail.com>
Acked-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/xt_connlimit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c index 2e89a00..70907f6 100644 --- a/net/netfilter/xt_connlimit.c +++ b/net/netfilter/xt_connlimit.c @@ -73,7 +73,8 @@ connlimit_iphash6(const union nf_inet_addr *addr, static inline bool already_closed(const struct nf_conn *conn) { if (nf_ct_protonum(conn) == IPPROTO_TCP) - return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT; + return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT || + conn->proto.tcp.state == TCP_CONNTRACK_CLOSE; else return 0; } |