svn commit: r333604 - head/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Mon May 14 15:16:52 UTC 2018


Author: tuexen
Date: Mon May 14 15:16:51 2018
New Revision: 333604
URL: https://svnweb.freebsd.org/changeset/base/333604

Log:
  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:
  head/sys/netinet/sctp_bsd_addr.c
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_bsd_addr.c
==============================================================================
--- head/sys/netinet/sctp_bsd_addr.c	Mon May 14 13:50:17 2018	(r333603)
+++ head/sys/netinet/sctp_bsd_addr.c	Mon May 14 15:16:51 2018	(r333604)
@@ -387,10 +387,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: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Mon May 14 13:50:17 2018	(r333603)
+++ head/sys/netinet/sctp_output.c	Mon May 14 15:16:51 2018	(r333604)
@@ -7450,7 +7450,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


More information about the svn-src-all mailing list