From owner-freebsd-net@FreeBSD.ORG Tue May 18 03:58:07 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57D0E1065670; Tue, 18 May 2010 03:58:07 +0000 (UTC) (envelope-from ysarumaru@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id E683D8FC15; Tue, 18 May 2010 03:58:06 +0000 (UTC) Received: by vws17 with SMTP id 17so310272vws.13 for ; Mon, 17 May 2010 20:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=hzBTnRALn4C/oiY+VJXGVVFkh/vfjXIuqtiEDftBbNE=; b=ZODNyp6aW3PKDmjko0TsfI+qiWgvZgs4U6MvPNeWtMfhseAjKwJWusxEqRdTVILChM 60qjoQODv4ADk5pfdOU1mnUP1Se1OwwmyrCMtegOmlfyKWJ9Kij+eNmyUy97yCgn1xC2 aGvnROOYfEr8JDJD38tsYy1Eqdct/3xvTy3b4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=HoB/WdKCJFIG3gCn00qb6BoEpuo3//bEIwesT/GemwPo8SpoI8SLWs+CnbhfHaVEkY LgUydEbxpCJQWyjR/swtpsecnoH1CiJavu9/tP1AtRMSTES2AQNYu4//MBfsZq13PqxR wgBqfmWrdcG3TOLXBxvl3LYoqDhMPkre4iIFE= MIME-Version: 1.0 Received: by 10.220.59.5 with SMTP id j5mr3074179vch.106.1274155086015; Mon, 17 May 2010 20:58:06 -0700 (PDT) Received: by 10.220.92.129 with HTTP; Mon, 17 May 2010 20:58:05 -0700 (PDT) In-Reply-To: <20100517190525.GP83316@deviant.kiev.zoral.com.ua> References: <20100517190525.GP83316@deviant.kiev.zoral.com.ua> Date: Tue, 18 May 2010 12:58:05 +0900 Message-ID: From: Yoshihiko Sarumaru To: Kostik Belousov , kib@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org, freebsd-stable@freebsd.org Subject: Re: odd behavior on select() after shutdown() 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: Tue, 18 May 2010 03:58:07 -0000 Hi, 2010/5/18 Kostik Belousov : > On Tue, May 18, 2010 at 01:08:50AM +0900, Yoshihiko Sarumaru wrote: >> Hi all, >> >> Select(2) has three arguments to get socket status for read, write and except. >> After upgrading to 8.0-RELEASE, select() after shutdown(SHUT_WR) returns with >> the status exceptfds is set. It means out-of-bound data can be read >> from the socket, >> but recv() with OOB flag returns ECONNRESET, and no packets with urgent flag >> was observed by tcpdump. >> It seems strange for me, but is it an intentional change on 8.x ? > The patch below would fix the problem at hand. I am wondering what > unintended consequences it might have. It works perfect for me on 8.0-RELEASE, thanks! I can't see how much this change has side effects, but is it commitable to current or stable? Kib, it seems you had changed some code using POLLHUP in uipc_socket.c. I'm not sure it is related to this issue, but could you give us your comments? thanks, - yoshihiko