From owner-freebsd-net@FreeBSD.ORG Mon Jun 19 13:49:54 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 94F5C16A479 for ; Mon, 19 Jun 2006 13:49:54 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C268D43D6A for ; Mon, 19 Jun 2006 13:49:51 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 48583 invoked from network); 19 Jun 2006 13:49:34 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 19 Jun 2006 13:49:34 -0000 Message-ID: <4496AB80.5040306@freebsd.org> Date: Mon, 19 Jun 2006 15:49:52 +0200 From: Andre Oppermann User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Blue References: <449604D0.8090701@zyxel.com.tw> In-Reply-To: <449604D0.8090701@zyxel.com.tw> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: [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 13:49:54 -0000 Blue wrote: > 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; > } This code is dead at the moment since most of T/TCP (RFC1644) was removed and the SYN_RECEIVED case is no longer handled here but in tcp_syncache.c. -- Andre