From owner-svn-src-all@FreeBSD.ORG Tue Oct 14 22:48:38 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61AF11065689; Tue, 14 Oct 2008 22:48:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9B38FC16; Tue, 14 Oct 2008 22:48:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9EMmcAc017958; Tue, 14 Oct 2008 22:48:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9EMmcOG017957; Tue, 14 Oct 2008 22:48:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810142248.m9EMmcOG017957@svn.freebsd.org> From: Robert Watson Date: Tue, 14 Oct 2008 22:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183898 - in stable/7/sys: . kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 22:48:38 -0000 Author: rwatson Date: Tue Oct 14 22:48:38 2008 New Revision: 183898 URL: http://svn.freebsd.org/changeset/base/183898 Log: Merge r183675 from head to stable/7: In soreceive_dgram, when a 0-length buffer is passed into recv(2) and no data is ready, return 0 rather than blocking or returning EAGAIN. This is consistent with the behavior of soreceive_generic (soreceive) in earlier versions of FreeBSD, and restores this behavior for UDP. Discussed with: jhb, sam Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/uipc_socket.c Modified: stable/7/sys/kern/uipc_socket.c ============================================================================== --- stable/7/sys/kern/uipc_socket.c Tue Oct 14 22:11:18 2008 (r183897) +++ stable/7/sys/kern/uipc_socket.c Tue Oct 14 22:48:38 2008 (r183898) @@ -1900,7 +1900,8 @@ soreceive_dgram(struct socket *so, struc SOCKBUF_UNLOCK(&so->so_rcv); return (error); } - if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { + if (so->so_rcv.sb_state & SBS_CANTRCVMORE || + uio->uio_resid == 0) { SOCKBUF_UNLOCK(&so->so_rcv); return (0); }