Subject: Re: [PATCH net-next-2.6] Re: TCP/IP stack interpretation of acceptable packet

From: John Dykstra <[email-masked]>
Date: Mon, 23 Mar 2009 10:13:31 -0500

On Sun, 2009-03-22 at 21:50 -0700, David Miller wrote:
> I've been mulling over this patch for more than a week :-)

FWIW, FreeBSD 6.1 discards segments with these over-eager acknowledgment
fields.  It also sends back the pure ACK that I chose not to add.  

I didn't look at any other OS's.

On Mon, 2009-03-23 at 13:28 +0100, Andi Kleen wrote:
> One thing that might be useful for the testing period would 
> be explicit printk when such a new discard happens? 

[PATCH net-next-2.6]  tcp: Log discarded segments with too-high ack fields

Log a rate-limited message when a TCP segment is discarded because
its ack field is beyond the last data sent.  This logging was suggested
by Andi Kleen.

Signed-off-by: John Dykstra <[email-masked]>
---
 net/ipv4/tcp_input.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 01544cd..37343e4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3690,7 +3690,9 @@ no_queue:
 	return 1;
 
 invalid_ack:
-	SOCK_DEBUG(sk, "Ack %u after %u:%u\n", ack, tp->snd_una, tp->snd_nxt);
+	if (printk_ratelimit())
+		printk(KERN_NOTICE "Ack %u after %u:%u;  segment discarded\n",
+		    ack, tp->snd_una, tp->snd_nxt);
 	return -1;
 	
 old_ack:
-- 
1.5.4.3