From owner-freebsd-net@FreeBSD.ORG Mon Jun 19 02:24:59 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1CB816A474 for ; Mon, 19 Jun 2006 02:24:59 +0000 (UTC) (envelope-from Susan.Lan@zyxel.com.tw) Received: from zyadd226.zyxel.com.tw (zyadd226.zyxel.com.tw [61.222.65.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACB8F43D45 for ; Mon, 19 Jun 2006 02:24:56 +0000 (GMT) (envelope-from Susan.Lan@zyxel.com.tw) Received: from zytwbe01.zyxel.com ([172.23.5.10]) by smtp.zyxel.com.tw with InterScan Messaging Security Suite; Mon, 19 Jun 2006 10:08:52 +0800 Received: from zytwfe01.ZyXEL.com ([172.23.5.5]) by zytwbe01.zyxel.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 19 Jun 2006 10:00:40 +0800 Received: from [172.23.18.2] ([172.23.18.2]) by zytwfe01.ZyXEL.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 19 Jun 2006 10:00:39 +0800 Message-ID: <449604D0.8090701@zyxel.com.tw> Date: Mon, 19 Jun 2006 09:58:40 +0800 From: Blue User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Jun 2006 02:00:39.0912 (UTC) FILETIME=[2A0BE680:01C69344] Subject: [freeBSD-6.1RELEASE] wonderings about function tcp_input() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jun 2006 02:24:59 -0000 Hi, all: I have a question about line 1765 to 1776 in tcp_input(): /* * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN * flag is on (half-synchronized state), then queue data for * later processing; else drop segment and return. */ if ((thflags & TH_ACK) == 0) { if (tp->t_state == TCPS_SYN_RECEIVED || (tp->t_flags & TF_NEEDSYN)) goto step6; else goto drop; } My question is: if we are currently in TCPS_SYN_RECEIVED state, why does a segment without ACK bother? Why we need to store the segment and process it? Without considering T/TCP, the code should be: if ((thflags & TH_ACK) == 0) { goto drop; } Best regards, blue