From owner-p4-projects@FreeBSD.ORG Tue Sep 6 13:41:30 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0F057106567C; Tue, 6 Sep 2011 13:41:30 +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 C596B1065679 for ; Tue, 6 Sep 2011 13:41:29 +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 B310E8FC0A for ; Tue, 6 Sep 2011 13:41:29 +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 p86DfTJt015099 for ; Tue, 6 Sep 2011 13:41:29 GMT (envelope-from cnicutar@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p86DfTn7015096 for perforce@freebsd.org; Tue, 6 Sep 2011 13:41:29 GMT (envelope-from cnicutar@freebsd.org) Date: Tue, 6 Sep 2011 13:41:29 GMT Message-Id: <201109061341.p86DfTn7015096@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 198632 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: Tue, 06 Sep 2011 13:41:30 -0000 http://p4web.freebsd.org/@@198632?ac=10 Change 198632 by cnicutar@cnicutar_cronos on 2011/09/06 13:40:44 Attach UTO to first non-SYN segment sent so it gets retransmitted if needed. Done by checking the sequence and acknowledgement numbers. Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_output.c#4 edit .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_var.h#8 edit Differences ... ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_output.c#4 (text+ko) ==== @@ -705,17 +705,14 @@ to.to_sacks = (u_char *)tp->sackblks; } } - /* UTO */ - if (tp->t_flags & TF_SND_UTO) { + /* + * UTO. The option is sent with the SYN and with the first + * non-SYN segment. + */ + if (tp->t_flags & TF_SND_UTO && (flags & TH_SYN || + FIRST_NON_SYN(tp))) { 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_9/src/sys/netinet/tcp_var.h#8 (text+ko) ==== @@ -268,6 +268,10 @@ #define UTO_VALUE(to) ((to).to_uto & UTO_MINS) ? \ ((to).to_uto & ~(UTO_MINS)) * 60 : (to).to_uto +#define FIRST_NON_SYN(tp) (TCPS_HAVEESTABLISHED((tp)->t_state) && \ + (tp)->snd_nxt == (tp)->iss + 1 && \ + (tp)->rcv_nxt == (tp)->irs + 1) + /* * Flags for the t_oobflags field. */