The branch stable/13 has been updated by tuexen:

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

commit c813c96d678a01d19f2124f0db376fdafa8ac6f2
Author:     Michael Tuexen <tue...@freebsd.org>
AuthorDate: 2023-09-08 12:19:56 +0000
Commit:     Michael Tuexen <tue...@freebsd.org>
CommitDate: 2024-01-11 12:55:56 +0000

    sctp: make sure all SCTP RESET notifications use sctp_ulp_notify()
    
    While there, improve consistency of the notification related code.
    No functional change intended.
    
    (cherry picked from commit 3ac7664774ad038b208cbb31eb52d1608efbd451)
---
 sys/netinet/sctp_constants.h |  14 +++--
 sys/netinet/sctp_input.c     |  26 ++++-----
 sys/netinet/sctputil.c       | 135 ++++++++++++++++++++++---------------------
 sys/netinet/sctputil.h       |   6 --
 4 files changed, 86 insertions(+), 95 deletions(-)

diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h
index 05e804100aa2..d11fe11d5e8f 100644
--- a/sys/netinet/sctp_constants.h
+++ b/sys/netinet/sctp_constants.h
@@ -706,12 +706,14 @@
 #define SCTP_NOTIFY_STR_RESET_FAILED_IN         20
 #define SCTP_NOTIFY_STR_RESET_DENIED_OUT        21
 #define SCTP_NOTIFY_STR_RESET_DENIED_IN         22
-#define SCTP_NOTIFY_AUTH_NEW_KEY                23
-#define SCTP_NOTIFY_AUTH_FREE_KEY               24
-#define SCTP_NOTIFY_NO_PEER_AUTH                25
-#define SCTP_NOTIFY_SENDER_DRY                  26
-#define SCTP_NOTIFY_REMOTE_ERROR                27
-#define SCTP_NOTIFY_ASSOC_TIMEDOUT              28
+#define SCTP_NOTIFY_STR_RESET_ADD               23
+#define SCTP_NOTIFY_STR_RESET_TSN               24
+#define SCTP_NOTIFY_AUTH_NEW_KEY                25
+#define SCTP_NOTIFY_AUTH_FREE_KEY               26
+#define SCTP_NOTIFY_NO_PEER_AUTH                27
+#define SCTP_NOTIFY_SENDER_DRY                  28
+#define SCTP_NOTIFY_REMOTE_ERROR                29
+#define SCTP_NOTIFY_ASSOC_TIMEDOUT              30
 
 /* This is the value for messages that are NOT completely
  * copied down where we will start to split the message.
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 5d2a3dd26384..7ad9eec07897 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -3508,23 +3508,19 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb,
                                                asoc->strmout[i].state = 
SCTP_STREAM_OPEN;
                                        }
                                        asoc->streamoutcnt += num_stream;
-                                       sctp_notify_stream_reset_add(stcb, 
stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0);
+                                       
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, 0, NULL, SCTP_SO_NOT_LOCKED);
                                } else if (action == 
SCTP_STREAM_RESET_RESULT_DENIED) {
-                                       sctp_notify_stream_reset_add(stcb, 
stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
-                                           SCTP_STREAM_CHANGE_DENIED);
+                                       
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, SCTP_STREAM_CHANGE_DENIED, 
NULL, SCTP_SO_NOT_LOCKED);
                                } else {
-                                       sctp_notify_stream_reset_add(stcb, 
stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
-                                           SCTP_STREAM_CHANGE_FAILED);
+                                       
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, SCTP_STREAM_CHANGE_FAILED, 
NULL, SCTP_SO_NOT_LOCKED);
                                }
                        } else if (type == SCTP_STR_RESET_ADD_IN_STREAMS) {
                                if (asoc->stream_reset_outstanding)
                                        asoc->stream_reset_outstanding--;
                                if (action == SCTP_STREAM_RESET_RESULT_DENIED) {
-                                       sctp_notify_stream_reset_add(stcb, 
stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
-                                           SCTP_STREAM_CHANGE_DENIED);
+                                       
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, SCTP_STREAM_CHANGE_DENIED, 
NULL, SCTP_SO_NOT_LOCKED);
                                } else if (action != 
SCTP_STREAM_RESET_RESULT_PERFORMED) {
-                                       sctp_notify_stream_reset_add(stcb, 
stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
-                                           SCTP_STREAM_CHANGE_FAILED);
+                                       
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, SCTP_STREAM_CHANGE_DENIED, 
NULL, SCTP_SO_NOT_LOCKED);
                                }
                        } else if (type == SCTP_STR_RESET_TSN_REQUEST) {
                                /**
@@ -3570,13 +3566,11 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb,
 
                                        sctp_reset_out_streams(stcb, 0, 
(uint16_t *)NULL);
                                        sctp_reset_in_stream(stcb, 0, (uint16_t 
*)NULL);
-                                       sctp_notify_stream_reset_tsn(stcb, 
stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1), 0);
+                                       
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_TSN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED);
                                } else if (action == 
SCTP_STREAM_RESET_RESULT_DENIED) {
-                                       sctp_notify_stream_reset_tsn(stcb, 
stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1),
-                                           SCTP_ASSOC_RESET_DENIED);
+                                       
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_TSN, stcb, SCTP_ASSOC_RESET_DENIED, NULL, 
SCTP_SO_NOT_LOCKED);
                                } else {
-                                       sctp_notify_stream_reset_tsn(stcb, 
stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1),
-                                           SCTP_ASSOC_RESET_FAILED);
+                                       
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_TSN, stcb, SCTP_ASSOC_RESET_FAILED, NULL, 
SCTP_SO_NOT_LOCKED);
                                }
                        }
                        /* get rid of the request and get the request flags */
@@ -3705,7 +3699,7 @@ sctp_handle_str_reset_request_tsn(struct sctp_tcb *stcb,
                        sctp_reset_out_streams(stcb, 0, (uint16_t *)NULL);
                        sctp_reset_in_stream(stcb, 0, (uint16_t *)NULL);
                        asoc->last_reset_action[0] = 
SCTP_STREAM_RESET_RESULT_PERFORMED;
-                       sctp_notify_stream_reset_tsn(stcb, asoc->sending_seq, 
(asoc->mapping_array_base_tsn + 1), 0);
+                       sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_TSN, stcb, 0, 
NULL, SCTP_SO_NOT_LOCKED);
                }
                sctp_add_stream_reset_result_tsn(chk, seq, 
asoc->last_reset_action[0],
                    asoc->last_sending_seq[0], asoc->last_base_tsnsent[0]);
@@ -3870,7 +3864,7 @@ sctp_handle_str_reset_add_strm(struct sctp_tcb *stcb, 
struct sctp_tmit_chunk *ch
                        /* update the size */
                        stcb->asoc.streamincnt = num_stream;
                        stcb->asoc.last_reset_action[0] = 
SCTP_STREAM_RESET_RESULT_PERFORMED;
-                       sctp_notify_stream_reset_add(stcb, 
stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0);
+                       sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD, stcb, 0, 
NULL, SCTP_SO_NOT_LOCKED);
                }
                sctp_add_stream_reset_result(chk, seq, 
asoc->last_reset_action[0]);
                asoc->str_reset_seq_in++;
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index f4013a4816c7..b378a55250e0 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -3138,9 +3138,10 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb 
*stcb,
        struct mbuf *m_notify;
        struct sctp_assoc_change *sac;
        struct sctp_queued_to_read *control;
+       struct sctp_inpcb *inp;
        unsigned int notif_len;
-       uint16_t abort_len;
        unsigned int i;
+       uint16_t abort_len;
 
        KASSERT(abort == NULL || from_peer,
            ("sctp_notify_assoc_change: ABORT chunk provided for local 
termination"));
@@ -3149,7 +3150,8 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb 
*stcb,
        if (stcb == NULL) {
                return;
        }
-       if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, 
SCTP_PCB_FLAGS_RECVASSOCEVNT)) {
+       inp = stcb->sctp_ep;
+       if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) {
                notif_len = (unsigned int)sizeof(struct sctp_assoc_change);
                if (abort != NULL) {
                        abort_len = ntohs(abort->ch.chunk_length);
@@ -3227,10 +3229,9 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb 
*stcb,
                        control->spec_flags = M_NOTIFICATION;
                        /* not that we need this */
                        control->tail_mbuf = m_notify;
-                       sctp_add_to_readq(stcb->sctp_ep, stcb,
-                           control,
-                           &stcb->sctp_socket->so_rcv, 1, 
SCTP_READ_LOCK_NOT_HELD,
-                           so_locked);
+                       sctp_add_to_readq(inp, stcb, control,
+                           &stcb->sctp_socket->so_rcv, 1,
+                           SCTP_READ_LOCK_NOT_HELD, so_locked);
                } else {
                        sctp_m_freem(m_notify);
                }
@@ -3240,8 +3241,8 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb 
*stcb,
         * comes in.
         */
 set_error:
-       if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
-           (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
+       if (((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
+           (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
            ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
                SOCK_LOCK(stcb->sctp_socket);
                if (from_peer) {
@@ -3264,8 +3265,8 @@ set_error:
                SOCK_UNLOCK(stcb->sctp_socket);
        }
        /* Wake ANY sleepers */
-       if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
-           (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
+       if (((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
+           (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
            ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
                socantrcvmore(stcb->sctp_socket);
        }
@@ -3354,11 +3355,9 @@ sctp_notify_peer_addr_change(struct sctp_tcb *stcb, 
uint32_t state,
        control->spec_flags = M_NOTIFICATION;
        /* not that we need this */
        control->tail_mbuf = m_notify;
-       sctp_add_to_readq(stcb->sctp_ep, stcb,
-           control,
+       sctp_add_to_readq(stcb->sctp_ep, stcb, control,
            &stcb->sctp_socket->so_rcv, 1,
-           SCTP_READ_LOCK_NOT_HELD,
-           so_locked);
+           SCTP_READ_LOCK_NOT_HELD, so_locked);
 }
 
 static void
@@ -3485,11 +3484,9 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t 
sent, uint32_t error,
        control->spec_flags = M_NOTIFICATION;
        /* not that we need this */
        control->tail_mbuf = m_notify;
-       sctp_add_to_readq(stcb->sctp_ep, stcb,
-           control,
+       sctp_add_to_readq(stcb->sctp_ep, stcb, control,
            &stcb->sctp_socket->so_rcv, 1,
-           SCTP_READ_LOCK_NOT_HELD,
-           so_locked);
+           SCTP_READ_LOCK_NOT_HELD, so_locked);
 }
 
 static void
@@ -3583,13 +3580,13 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, 
uint32_t error,
        control->spec_flags = M_NOTIFICATION;
        /* not that we need this */
        control->tail_mbuf = m_notify;
-       sctp_add_to_readq(stcb->sctp_ep, stcb,
-           control,
-           &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked);
+       sctp_add_to_readq(stcb->sctp_ep, stcb, control,
+           &stcb->sctp_socket->so_rcv, 1,
+           SCTP_READ_LOCK_NOT_HELD, so_locked);
 }
 
 static void
-sctp_notify_adaptation_layer(struct sctp_tcb *stcb)
+sctp_notify_adaptation_layer(struct sctp_tcb *stcb, int so_locked)
 {
        struct mbuf *m_notify;
        struct sctp_adaptation_event *sai;
@@ -3630,9 +3627,9 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb)
        control->spec_flags = M_NOTIFICATION;
        /* not that we need this */
        control->tail_mbuf = m_notify;
-       sctp_add_to_readq(stcb->sctp_ep, stcb,
-           control,
-           &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
+       sctp_add_to_readq(stcb->sctp_ep, stcb, control,
+           &stcb->sctp_socket->so_rcv, 1,
+           SCTP_READ_LOCK_NOT_HELD, so_locked);
 }
 
 static void
@@ -3700,7 +3697,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb 
*stcb, uint32_t error,
 }
 
 static void
-sctp_notify_shutdown_event(struct sctp_tcb *stcb)
+sctp_notify_shutdown_event(struct sctp_tcb *stcb, int so_locked)
 {
        struct mbuf *m_notify;
        struct sctp_shutdown_event *sse;
@@ -3747,14 +3744,13 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb)
        control->spec_flags = M_NOTIFICATION;
        /* not that we need this */
        control->tail_mbuf = m_notify;
-       sctp_add_to_readq(stcb->sctp_ep, stcb,
-           control,
-           &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
+       sctp_add_to_readq(stcb->sctp_ep, stcb, control,
+           &stcb->sctp_socket->so_rcv, 1,
+           SCTP_READ_LOCK_NOT_HELD, so_locked);
 }
 
 static void
-sctp_notify_sender_dry_event(struct sctp_tcb *stcb,
-    int so_locked)
+sctp_notify_sender_dry_event(struct sctp_tcb *stcb, int so_locked)
 {
        struct mbuf *m_notify;
        struct sctp_sender_dry_event *event;
@@ -3796,11 +3792,12 @@ sctp_notify_sender_dry_event(struct sctp_tcb *stcb,
        /* not that we need this */
        control->tail_mbuf = m_notify;
        sctp_add_to_readq(stcb->sctp_ep, stcb, control,
-           &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked);
+           &stcb->sctp_socket->so_rcv, 1,
+           SCTP_READ_LOCK_NOT_HELD, so_locked);
 }
 
-void
-sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, 
uint16_t numberout, int flag)
+static void
+sctp_notify_stream_reset_add(struct sctp_tcb *stcb, int flag, int so_locked)
 {
        struct mbuf *m_notify;
        struct sctp_queued_to_read *control;
@@ -3835,8 +3832,8 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, 
uint16_t numberin, uint16_t
        stradd->strchange_flags = flag;
        stradd->strchange_length = sizeof(struct sctp_stream_change_event);
        stradd->strchange_assoc_id = sctp_get_associd(stcb);
-       stradd->strchange_instrms = numberin;
-       stradd->strchange_outstrms = numberout;
+       stradd->strchange_instrms = stcb->asoc.streamincnt;
+       stradd->strchange_outstrms = stcb->asoc.streamoutcnt;
        SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_stream_change_event);
        SCTP_BUF_NEXT(m_notify) = NULL;
        if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < 
SCTP_BUF_LEN(m_notify)) {
@@ -3857,13 +3854,13 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, 
uint16_t numberin, uint16_t
        control->spec_flags = M_NOTIFICATION;
        /* not that we need this */
        control->tail_mbuf = m_notify;
-       sctp_add_to_readq(stcb->sctp_ep, stcb,
-           control,
-           &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
+       sctp_add_to_readq(stcb->sctp_ep, stcb, control,
+           &stcb->sctp_socket->so_rcv, 1,
+           SCTP_READ_LOCK_NOT_HELD, so_locked);
 }
 
-void
-sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, 
uint32_t recv_tsn, int flag)
+static void
+sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, int flag, int so_locked)
 {
        struct mbuf *m_notify;
        struct sctp_queued_to_read *control;
@@ -3892,8 +3889,8 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, 
uint32_t sending_tsn, uint32
        strasoc->assocreset_flags = flag;
        strasoc->assocreset_length = sizeof(struct sctp_assoc_reset_event);
        strasoc->assocreset_assoc_id = sctp_get_associd(stcb);
-       strasoc->assocreset_local_tsn = sending_tsn;
-       strasoc->assocreset_remote_tsn = recv_tsn;
+       strasoc->assocreset_local_tsn = stcb->asoc.sending_seq;
+       strasoc->assocreset_remote_tsn = stcb->asoc.mapping_array_base_tsn + 1;
        SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_assoc_reset_event);
        SCTP_BUF_NEXT(m_notify) = NULL;
        if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < 
SCTP_BUF_LEN(m_notify)) {
@@ -3914,14 +3911,14 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, 
uint32_t sending_tsn, uint32
        control->spec_flags = M_NOTIFICATION;
        /* not that we need this */
        control->tail_mbuf = m_notify;
-       sctp_add_to_readq(stcb->sctp_ep, stcb,
-           control,
-           &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
+       sctp_add_to_readq(stcb->sctp_ep, stcb, control,
+           &stcb->sctp_socket->so_rcv, 1,
+           SCTP_READ_LOCK_NOT_HELD, so_locked);
 }
 
 static void
 sctp_notify_stream_reset(struct sctp_tcb *stcb,
-    int number_entries, uint16_t *list, int flag)
+    int number_entries, uint16_t *list, int flag, int so_locked)
 {
        struct mbuf *m_notify;
        struct sctp_queued_to_read *control;
@@ -3978,13 +3975,14 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb,
        control->spec_flags = M_NOTIFICATION;
        /* not that we need this */
        control->tail_mbuf = m_notify;
-       sctp_add_to_readq(stcb->sctp_ep, stcb,
-           control,
-           &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
+       sctp_add_to_readq(stcb->sctp_ep, stcb, control,
+           &stcb->sctp_socket->so_rcv, 1,
+           SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
 }
 
 static void
-sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct 
sctp_error_chunk *chunk)
+sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error,
+    struct sctp_error_chunk *chunk, int so_locked)
 {
        struct mbuf *m_notify;
        struct sctp_remote_error *sre;
@@ -4039,10 +4037,9 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t 
error, struct sctp_erro
                control->spec_flags = M_NOTIFICATION;
                /* not that we need this */
                control->tail_mbuf = m_notify;
-               sctp_add_to_readq(stcb->sctp_ep, stcb,
-                   control,
+               sctp_add_to_readq(stcb->sctp_ep, stcb, control,
                    &stcb->sctp_socket->so_rcv, 1,
-                   SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
+                   SCTP_READ_LOCK_NOT_HELD, so_locked);
        } else {
                sctp_m_freem(m_notify);
        }
@@ -4084,11 +4081,10 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb 
*stcb,
                        stcb->asoc.assoc_up_sent = 1;
                }
                if (stcb->asoc.adaptation_needed && (stcb->asoc.adaptation_sent 
== 0)) {
-                       sctp_notify_adaptation_layer(stcb);
+                       sctp_notify_adaptation_layer(stcb, so_locked);
                }
                if (stcb->asoc.auth_supported == 0) {
-                       sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0,
-                           NULL, so_locked);
+                       sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, 
NULL, so_locked);
                }
                break;
        case SCTP_NOTIFY_ASSOC_DOWN:
@@ -4153,31 +4149,36 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb 
*stcb,
        case SCTP_NOTIFY_ASSOC_RESTART:
                sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, 
false, false, so_locked);
                if (stcb->asoc.auth_supported == 0) {
-                       sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0,
-                           NULL, so_locked);
+                       sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, 
NULL, so_locked);
                }
                break;
        case SCTP_NOTIFY_STR_RESET_SEND:
-               sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), 
SCTP_STREAM_RESET_OUTGOING_SSN);
+               sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), 
SCTP_STREAM_RESET_OUTGOING_SSN, so_locked);
                break;
        case SCTP_NOTIFY_STR_RESET_RECV:
-               sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), 
SCTP_STREAM_RESET_INCOMING);
+               sctp_notify_stream_reset(stcb, error, ((uint16_t *)data), 
SCTP_STREAM_RESET_INCOMING, so_locked);
                break;
        case SCTP_NOTIFY_STR_RESET_FAILED_OUT:
                sctp_notify_stream_reset(stcb, error, ((uint16_t *)data),
-                   (SCTP_STREAM_RESET_OUTGOING_SSN | 
SCTP_STREAM_RESET_FAILED));
+                   (SCTP_STREAM_RESET_OUTGOING_SSN | 
SCTP_STREAM_RESET_FAILED), so_locked);
                break;
        case SCTP_NOTIFY_STR_RESET_DENIED_OUT:
                sctp_notify_stream_reset(stcb, error, ((uint16_t *)data),
-                   (SCTP_STREAM_RESET_OUTGOING_SSN | 
SCTP_STREAM_RESET_DENIED));
+                   (SCTP_STREAM_RESET_OUTGOING_SSN | 
SCTP_STREAM_RESET_DENIED), so_locked);
                break;
        case SCTP_NOTIFY_STR_RESET_FAILED_IN:
                sctp_notify_stream_reset(stcb, error, ((uint16_t *)data),
-                   (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_FAILED));
+                   (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_FAILED), 
so_locked);
                break;
        case SCTP_NOTIFY_STR_RESET_DENIED_IN:
                sctp_notify_stream_reset(stcb, error, ((uint16_t *)data),
-                   (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_DENIED));
+                   (SCTP_STREAM_RESET_INCOMING | SCTP_STREAM_RESET_DENIED), 
so_locked);
+               break;
+       case SCTP_NOTIFY_STR_RESET_ADD:
+               sctp_notify_stream_reset_add(stcb, error, so_locked);
+               break;
+       case SCTP_NOTIFY_STR_RESET_TSN:
+               sctp_notify_stream_reset_tsn(stcb, error, so_locked);
                break;
        case SCTP_NOTIFY_ASCONF_ADD_IP:
                sctp_notify_peer_addr_change(stcb, SCTP_ADDR_ADDED, data,
@@ -4192,7 +4193,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb 
*stcb,
                    error, so_locked);
                break;
        case SCTP_NOTIFY_PEER_SHUTDOWN:
-               sctp_notify_shutdown_event(stcb);
+               sctp_notify_shutdown_event(stcb, so_locked);
                break;
        case SCTP_NOTIFY_AUTH_NEW_KEY:
                sctp_notify_authentication(stcb, SCTP_AUTH_NEW_KEY,
@@ -4210,7 +4211,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb 
*stcb,
                sctp_notify_sender_dry_event(stcb, so_locked);
                break;
        case SCTP_NOTIFY_REMOTE_ERROR:
-               sctp_notify_remote_error(stcb, error, data);
+               sctp_notify_remote_error(stcb, error, data, so_locked);
                break;
        default:
                SCTPDBG(SCTP_DEBUG_UTIL1, "%s: unknown notification %xh (%u)\n",
diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h
index c649611d5004..8de98b4608f8 100644
--- a/sys/netinet/sctputil.h
+++ b/sys/netinet/sctputil.h
@@ -80,12 +80,6 @@ int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, 
uint32_t, uint32_t, u
 
 void sctp_fill_random_store(struct sctp_pcb *);
 
-void
-sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin,
-    uint16_t numberout, int flag);
-void
-     sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, 
uint32_t recv_tsn, int flag);
-
 /*
  * NOTE: sctp_timer_start() will increment the reference count of any relevant
  * structure the timer is referencing, in order to prevent a race condition

Reply via email to