From owner-svn-src-head@FreeBSD.ORG Sat Oct 18 15:56:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE240106569D; Sat, 18 Oct 2008 15:56:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0418FC15; Sat, 18 Oct 2008 15:56:12 +0000 (UTC) (envelope-from rrs@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 m9IFuCbR020618; Sat, 18 Oct 2008 15:56:12 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9IFuCpt020617; Sat, 18 Oct 2008 15:56:12 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200810181556.m9IFuCpt020617@svn.freebsd.org> From: Randall Stewart Date: Sat, 18 Oct 2008 15:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184030 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2008 15:56:12 -0000 Author: rrs Date: Sat Oct 18 15:56:12 2008 New Revision: 184030 URL: http://svn.freebsd.org/changeset/base/184030 Log: New sockets (accepted) were not inheriting the proper snd/rcv buffer value. Obtained from: Michael Tuexen Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Oct 18 15:55:15 2008 (r184029) +++ head/sys/netinet/sctp_usrreq.c Sat Oct 18 15:56:12 2008 (r184030) @@ -517,9 +517,11 @@ sctp_attach(struct socket *so, int proto SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return EINVAL; } - error = SCTP_SORESERVE(so, SCTP_BASE_SYSCTL(sctp_sendspace), SCTP_BASE_SYSCTL(sctp_recvspace)); - if (error) { - return error; + if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { + error = SCTP_SORESERVE(so, SCTP_BASE_SYSCTL(sctp_sendspace), SCTP_BASE_SYSCTL(sctp_recvspace)); + if (error) { + return error; + } } error = sctp_inpcb_alloc(so, vrf_id); if (error) {