aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctputil.c
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2023-08-14 10:27:39 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2023-08-14 10:27:39 +0000
commit749a7fb588c4a872a4f1ce3ee92be86bab1b1f17 (patch)
treedf994b693e9e9782ef4b32f91b93bff078f9b20f /sys/netinet/sctputil.c
parent85a775e61b98f4c49abe437fb66b205a39f7581f (diff)
Diffstat (limited to 'sys/netinet/sctputil.c')
-rw-r--r--sys/netinet/sctputil.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index f85cf99a43fe..3a952a452289 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -3642,7 +3642,8 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb)
static void
sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
- uint32_t val, int so_locked)
+ struct sctp_queued_to_read *aborted_control,
+ int so_locked)
{
struct mbuf *m_notify;
struct sctp_pdapi_event *pdapi;
@@ -3655,6 +3656,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
return;
}
+ KASSERT(aborted_control != NULL, ("aborted_control is NULL"));
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);
@@ -3668,8 +3670,8 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
pdapi->pdapi_flags = 0;
pdapi->pdapi_length = sizeof(struct sctp_pdapi_event);
pdapi->pdapi_indication = error;
- pdapi->pdapi_stream = (val >> 16);
- pdapi->pdapi_seq = (val & 0x0000ffff);
+ pdapi->pdapi_stream = aborted_control->sinfo_stream;
+ pdapi->pdapi_seq = (uint16_t)aborted_control->mid;
pdapi->pdapi_assoc_id = sctp_get_associd(stcb);
SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_pdapi_event);
@@ -3695,12 +3697,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0);
}
control->end_added = 1;
- if (stcb->asoc.control_pdapi)
- TAILQ_INSERT_AFTER(&stcb->sctp_ep->read_queue, stcb->asoc.control_pdapi, control, next);
- else {
- /* we really should not see this case */
- TAILQ_INSERT_TAIL(&stcb->sctp_ep->read_queue, control, next);
- }
+ TAILQ_INSERT_AFTER(&stcb->sctp_ep->read_queue, aborted_control, control, next);
if (stcb->sctp_ep && stcb->sctp_socket) {
/* This should always be the case */
sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket);
@@ -4136,14 +4133,10 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb,
(struct sctp_tmit_chunk *)data, so_locked);
break;
case SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION:
- {
- uint32_t val;
-
- val = *((uint32_t *)data);
-
- sctp_notify_partial_delivery_indication(stcb, error, val, so_locked);
- break;
- }
+ sctp_notify_partial_delivery_indication(stcb, error,
+ (struct sctp_queued_to_read *)data,
+ so_locked);
+ break;
case SCTP_NOTIFY_ASSOC_LOC_ABORTED:
if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) ||
(SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) {