Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 May 2019 10:42:32 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r347146 - stable/11/sys/netinet
Message-ID:  <201905051042.x45AgWMP076529@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sun May  5 10:42:32 2019
New Revision: 347146
URL: https://svnweb.freebsd.org/changeset/base/347146

Log:
  MFC r333604:
  sctp_get_mbuf_for_msg() should honor the allinone parameter.
  
  When it is not required that the buffer is not a chain, return
  a chain. This is based on a patch provided by Irene Ruengeler.

Modified:
  stable/11/sys/netinet/sctp_bsd_addr.c
  stable/11/sys/netinet/sctp_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_bsd_addr.c
==============================================================================
--- stable/11/sys/netinet/sctp_bsd_addr.c	Sun May  5 09:02:32 2019	(r347145)
+++ stable/11/sys/netinet/sctp_bsd_addr.c	Sun May  5 10:42:32 2019	(r347146)
@@ -385,10 +385,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int w
 			m_freem(m);
 			return (NULL);
 		}
-	}
-	if (SCTP_BUF_NEXT(m)) {
-		sctp_m_freem(SCTP_BUF_NEXT(m));
-		SCTP_BUF_NEXT(m) = NULL;
+		KASSERT(SCTP_BUF_NEXT(m) == NULL, ("%s: no chain allowed", __FUNCTION__));
 	}
 #ifdef SCTP_MBUF_LOGGING
 	if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {

Modified: stable/11/sys/netinet/sctp_output.c
==============================================================================
--- stable/11/sys/netinet/sctp_output.c	Sun May  5 09:02:32 2019	(r347145)
+++ stable/11/sys/netinet/sctp_output.c	Sun May  5 10:42:32 2019	(r347146)
@@ -7467,7 +7467,7 @@ dont_do_it:
 		/* Not enough room for a chunk header, get some */
 		struct mbuf *m;
 
-		m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 0, MT_DATA);
+		m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 1, MT_DATA);
 		if (m == NULL) {
 			/*
 			 * we're in trouble here. _PREPEND below will free



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