]> git.hungrycats.org Git - linux/commitdiff
[NETFILTER]: Fix NAT helper handling of TCP window tracking info.
authorHarald Welte <laforge@netfilter.org>
Fri, 1 Oct 2004 08:11:57 +0000 (01:11 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Fri, 1 Oct 2004 08:11:57 +0000 (01:11 -0700)
Fix NAT helper code to update TCP window tracking information
if it resizes payload (and thus alrers sequence numbers).

This patchlet was somehow lost during 2.4.x->2.6.x port of TCP
window tracking :(

Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/ip_nat_helper.c

index e065a1ed0922771af14feb9e7133c41c07adbff7..d7ee32f05b6d1db6b2729aa51d4f021abd7281a0 100644 (file)
@@ -347,7 +347,7 @@ ip_nat_sack_adjust(struct sk_buff **pskb,
        return 1;
 }
 
-/* TCP sequence number adjustment.  Returns true or false.  */
+/* TCP sequence number adjustment.  Returns 1 on success, 0 on failure */
 int
 ip_nat_seq_adjust(struct sk_buff **pskb, 
                  struct ip_conntrack *ct, 
@@ -396,7 +396,12 @@ ip_nat_seq_adjust(struct sk_buff **pskb,
        tcph->seq = newseq;
        tcph->ack_seq = newack;
 
-       return ip_nat_sack_adjust(pskb, tcph, ct, ctinfo);
+       if (!ip_nat_sack_adjust(pskb, tcph, ct, ctinfo))
+               return 0;
+
+       ip_conntrack_tcp_update(*pskb, ct, dir);
+
+       return 1;
 }
 
 static inline int