]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[NETFILTER]: TCP conntrack: improve dead connection detection
authorGeorge Hansper <georgeh@anstat.com.au>
Wed, 20 Sep 2006 19:03:23 +0000 (12:03 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 22:19:57 +0000 (15:19 -0700)
Don't count window updates as retransmissions.

Signed-off-by: George Hansper <georgeh@anstat.com.au>
Signed-off-by: Patrick McHardy <kaber@trash.net>
include/linux/netfilter/nf_conntrack_tcp.h
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_proto_tcp.c

index b2feeffde38499a869714c9373c8bf2c3cef92de..6b01ba297727099dc11bc4f91bea4e5899cf44b2 100644 (file)
@@ -49,6 +49,7 @@ struct ip_ct_tcp
        u_int32_t       last_seq;       /* Last sequence number seen in dir */
        u_int32_t       last_ack;       /* Last sequence number seen in opposite dir */
        u_int32_t       last_end;       /* Last seq + len */
+       u_int16_t       last_win;       /* Last window advertisement seen in dir */
 };
 
 #endif /* __KERNEL__ */
index 75a7237eb8c15766e624f7eebaf0f7d6ebf3e52f..03ae9a04cb37c39351735394222f5de4b5b967a8 100644 (file)
@@ -731,13 +731,15 @@ static int tcp_in_window(struct ip_ct_tcp *state,
                        if (state->last_dir == dir
                            && state->last_seq == seq
                            && state->last_ack == ack
-                           && state->last_end == end)
+                           && state->last_end == end
+                           && state->last_win == win)
                                state->retrans++;
                        else {
                                state->last_dir = dir;
                                state->last_seq = seq;
                                state->last_ack = ack;
                                state->last_end = end;
+                               state->last_win = win;
                                state->retrans = 0;
                        }
                }
index 9fc0ee61f92a48636e7eba5ed0b4bca617587292..238bbb5b72ef5b5ba0f243321415ee6449959b98 100644 (file)
@@ -688,13 +688,15 @@ static int tcp_in_window(struct ip_ct_tcp *state,
                        if (state->last_dir == dir
                            && state->last_seq == seq
                            && state->last_ack == ack
-                           && state->last_end == end)
+                           && state->last_end == end
+                           && state->last_win == win)
                                state->retrans++;
                        else {
                                state->last_dir = dir;
                                state->last_seq = seq;
                                state->last_ack = ack;
                                state->last_end = end;
+                               state->last_win = win;
                                state->retrans = 0;
                        }
                }