From nobody@FreeBSD.org  Wed Jan  9 06:05:10 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id E3DE3CE2
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  9 Jan 2013 06:05:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id C0597305
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  9 Jan 2013 06:05:10 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r096592a030526
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 9 Jan 2013 06:05:09 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r09659J8030525;
	Wed, 9 Jan 2013 06:05:09 GMT
	(envelope-from nobody)
Message-Id: <201301090605.r09659J8030525@red.freebsd.org>
Date: Wed, 9 Jan 2013 06:05:09 GMT
From: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
To: freebsd-gnats-submit@FreeBSD.org
Subject: will there miss a FIN when do TSO?
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175153
>Category:       kern
>Synopsis:       [tcp] will there miss a FIN when do TSO?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 09 06:10:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Tue Jan 15 03:10:39 UTC 2013
>Originator:     Zhouyi Zhou
>Release:        FreeBSD current
>Organization:
ICT CAS
>Environment:
FreeBSD host48 8.2-RELEASE FreeBSD 8.2-RELEASE root@host48:/usr/src/sys.orig/amd64/compile/GENERIC
>Description:
Hi,
  I guess there will miss a FIN when do TSO in function tcp_output, following
is the code piece from CVS:
 	/*
	 * Adjust data length if insertion of options will
	 * bump the packet length beyond the t_maxopd length.
	 * Clear the FIN bit because we cut off the tail of
	 * the segment.
	 */
	if (len + optlen + ipoptlen > tp->t_maxopd) {
		flags &= ~TH_FIN;

		if (tso) {
			
        ....
		if (tp->t_flags & TF_NEEDFIN)
				sendalot = 1;
  ///////////////////////////////////////////////////////
  My question is when the FreeBSD close the established tcp connection actively,
the TF_NEEDFIN will not be set (am I got wrong?), and when previous computation
has not set sendalot to 1, the the tsoed packet will be the last packet to send 
out in this round, so a FIN is missed.

Thanks for your time
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Jan 15 03:10:22 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175153 
>Unformatted:
