From owner-freebsd-net@FreeBSD.ORG Fri May 1 10:27:08 2009 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D74B9106564A for ; Fri, 1 May 2009 10:27:08 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2018FC14 for ; Fri, 1 May 2009 10:27:08 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id B20F178CFD for ; Fri, 1 May 2009 10:11:41 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id n41ABftk009640 for ; Fri, 1 May 2009 10:11:41 GMT (envelope-from phk@critter.freebsd.dk) To: net@freebsd.org From: Poul-Henning Kamp Date: Fri, 01 May 2009 10:11:41 +0000 Message-ID: <9639.1241172701@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Subject: SO_LINGER + shutdown(2) 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: Fri, 01 May 2009 10:27:09 -0000 I was somewhat surprised to see that calling shutdown(SHUT_WR) on a TCP socket with SO_LINGER set {.l_onoff = 1, .l_linger = 0} does not in fact flush the send queue orderly, but immediately RST's the connection. I realize this is an issue for the Dept. of deep TCP arcanæ and not something to be changed lightly, so consider this more of an observation than bug report. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.