Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Oct 2008 15:56:12 +0000 (UTC)
From:      Randall Stewart <rrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184030 - head/sys/netinet
Message-ID:  <200810181556.m9IFuCpt020617@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



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