Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 17:26:16 +0000 (UTC)
From:      Randall Stewart <rrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r188522 - in stable/7/sys: . netinet
Message-ID:  <200902121726.n1CHQGgR061986@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rrs
Date: Thu Feb 12 17:26:16 2009
New Revision: 188522
URL: http://svn.freebsd.org/changeset/base/188522

Log:
  MFC of 184030 - socket accept inherit bug. Basically
                  accepted sockets were not inheriting the proper
                  sock buf size.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/netinet/sctp_usrreq.c

Modified: stable/7/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/7/sys/netinet/sctp_usrreq.c	Thu Feb 12 16:40:48 2009	(r188521)
+++ stable/7/sys/netinet/sctp_usrreq.c	Thu Feb 12 17:26:16 2009	(r188522)
@@ -516,9 +516,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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902121726.n1CHQGgR061986>