The branch main has been updated by tuexen:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e8eb0b713426fe9edbf56719351850fa9469286a

commit e8eb0b713426fe9edbf56719351850fa9469286a
Author:     Michael Tuexen <[email protected]>
AuthorDate: 2023-08-13 20:47:43 +0000
Commit:     Michael Tuexen <[email protected]>
CommitDate: 2023-08-13 20:47:43 +0000

    sctp: add an assert
    
    This enforces a condition mentioned in a comment.
    
    MFC after:      1 week
---
 sys/netinet/sctputil.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 136a2285c6d7..f85cf99a43fe 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -3640,7 +3640,6 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb)
            &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
 }
 
-/* This always must be called with the read-queue LOCKED in the INP */
 static void
 sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
     uint32_t val, int so_locked)
@@ -3656,6 +3655,8 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb 
*stcb, uint32_t error,
                return;
        }
 
+       SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep);
+
        m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, 
M_NOWAIT, 1, MT_DATA);
        if (m_notify == NULL)
                /* no space left */

Reply via email to