diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index b82dff1..489fc5d 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -9,6 +9,10 @@ * @{ */ +/*! \brief Access SCTP flags from the msgb control buffer */ +#define OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION 0x80 /* sctp_recvmsg() flags=MSG_NOTIFICATION, msgb_data() contains "union sctp_notification*" */ +#define msgb_sctp_msg_flags(msg) (msg)->cb[2] + /*! \brief Access the SCTP PPID from the msgb control buffer */ #define msgb_sctp_ppid(msg) (msg)->cb[3] /*! \brief Access the SCTP Stream ID from the msgb control buffer */ diff --git a/src/stream.c b/src/stream.c index bc209af..b45b730 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1476,6 +1476,7 @@ static int _sctp_recvmsg_wrapper(int fd, struct msgb *msg) if (flags & MSG_NOTIFICATION) { union sctp_notification *notif = (union sctp_notification *)msgb_data(msg); LOGP(DLINP, LOGL_DEBUG, "NOTIFICATION %u flags=0x%x\n", notif->sn_header.sn_type, notif->sn_header.sn_flags); + msgb_sctp_msg_flags(msg) = OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION; switch (notif->sn_header.sn_type) { case SCTP_ASSOC_CHANGE: LOGP(DLINP, LOGL_DEBUG, "===> ASSOC CHANGE:");