From owner-p4-projects@FreeBSD.ORG Thu Jul 7 07:43:34 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C086A1065674; Thu, 7 Jul 2011 07:43:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79DC61065672 for ; Thu, 7 Jul 2011 07:43:33 +0000 (UTC) (envelope-from cnicutar@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 68B5E8FC14 for ; Thu, 7 Jul 2011 07:43:33 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p677hXVP011151 for ; Thu, 7 Jul 2011 07:43:33 GMT (envelope-from cnicutar@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p677hXv9011148 for perforce@freebsd.org; Thu, 7 Jul 2011 07:43:33 GMT (envelope-from cnicutar@freebsd.org) Date: Thu, 7 Jul 2011 07:43:33 GMT Message-Id: <201107070743.p677hXv9011148@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to cnicutar@freebsd.org using -f From: Catalin Nicutar To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 195838 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 07:43:34 -0000 http://p4web.freebsd.org/@@195838?ac=10 Change 195838 by cnicutar@cnicutar_cronos on 2011/07/07 07:43:12 Send UTO on SYN and on the first non-SYN segment sent (as advised by RFC 5482, sections 3 and 4.1). Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_output.c#6 edit .. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_timer.c#5 edit Differences ... ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_output.c#6 (text+ko) ==== @@ -705,9 +705,16 @@ } } /* UTO */ - if ((flags & TH_SYN) && (tp->t_flags & TF_SND_UTO)) { + if (tp->t_flags & TF_SND_UTO) { to.to_uto = tp->snd_uto; to.to_flags |= TOF_UTO; + /* + * The option is sent with the SYN and with the first + * non-SYN segment. + */ + if (!(flags & TH_SYN)) + tp->t_flags &= ~TF_SND_UTO; + } #ifdef TCP_SIGNATURE /* TCP-MD5 (RFC2385). */ ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_timer.c#5 (text+ko) ==== @@ -305,8 +305,7 @@ return; } callout_deactivate(&tp->t_timers->tt_keep); - if ((tp->t_flags & TF_SND_UTO) || ((tp->t_flags & TF_RCV_UTO) && - tp->rcv_uto)) { + if ((tp->snd_uto) || ((tp->t_flags & TF_RCV_UTO) && tp->rcv_uto)) { /* * This connection is using UTO (either sending or has * received a value). We need to stop sending keepalives @@ -493,8 +492,7 @@ /* UTO starting again since it's the first retransmit. */ tp->t_suto = 0; - if ((tp->t_flags & TF_SND_UTO) || ((tp->t_flags & TF_RCV_UTO) && - tp->rcv_uto)) { + if (tp->snd_uto || ((tp->t_flags & TF_RCV_UTO) && tp->rcv_uto)) { /* * Since we're using UTO for this connection we need to * compute how much time we've got left.