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.
This commit is contained in:
Michael Tuexen 2018-05-14 15:16:51 +00:00
parent 589c42c2c8
commit 482d420926
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333604
2 changed files with 2 additions and 5 deletions

View File

@ -387,10 +387,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header,
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) {

View File

@ -7450,7 +7450,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb,
/* 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