From patchwork Thu Jan 7 03:21:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 42388 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 71EB1B6F1A for ; Thu, 7 Jan 2010 14:21:33 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756680Ab0AGDV0 (ORCPT ); Wed, 6 Jan 2010 22:21:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756675Ab0AGDV0 (ORCPT ); Wed, 6 Jan 2010 22:21:26 -0500 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:56157 "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756331Ab0AGDVZ (ORCPT ); Wed, 6 Jan 2010 22:21:25 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id BED8724C140; Wed, 6 Jan 2010 19:21:31 -0800 (PST) Date: Wed, 06 Jan 2010 19:21:31 -0800 (PST) Message-Id: <20100106.192131.193700514.davem@davemloft.net> To: netdev@vger.kernel.org Cc: nhorman@tuxdriver.com, ilpo.jarvinen@helsinki.fi Subject: Re: BSD 4.2 style TCP keepalives From: David Miller In-Reply-To: <20100106.161454.193705075.davem@davemloft.net> References: <20100106.002328.141253811.davem@davemloft.net> <20100106.150453.186399201.davem@davemloft.net> <20100106.161454.193705075.davem@davemloft.net> X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Miller Date: Wed, 06 Jan 2010 16:14:54 -0800 (PST) > +#if 1 > + /* Construct BSD 4.2 style zero-window probe with one > + * out-of-window garbage data byte. > + * > + * XXX this does the wrong thing when 'urgent' is true > + */ > + { > + unsigned char *garbage_byte = skb_put(skb, 1); > + > + *garbage_byte = 0xff; > + TCP_SKB_CB(skb)->end_seq++; > + } > +#endif This doesn't work so well, because the checksum will be wrong. The patch at the end of this email should work better. And maybe that's a clue, because with this upstream Linux does ACK the probe. So I wonder if the Windows 2000 systems don't calculate the checksum correctly? More mysterious by the minute :-) --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 383ce23..ce0ae32 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2727,6 +2727,20 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent) * send it. */ tcp_init_nondata_skb(skb, tp->snd_una - !urgent, TCPCB_FLAG_ACK); +#if 1 + /* Construct BSD 4.2 style zero-window probe with one + * out-of-window garbage data byte. + * + * XXX this does the wrong thing when 'urgent' is true + */ + { + unsigned char *garbage_byte = skb_put(skb, 1); + + *garbage_byte = 0xff; + TCP_SKB_CB(skb)->end_seq++; + skb->ip_summed = CHECKSUM_PARTIAL; + } +#endif TCP_SKB_CB(skb)->when = tcp_time_stamp; return tcp_transmit_skb(sk, skb, 0, GFP_ATOMIC); }