pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29541 )
Change subject: stream: Erase sctp_msg_flags if receiving user data ......................................................................
stream: Erase sctp_msg_flags if receiving user data
It could be that the user reuses the msgb passed to osmo_stream_srv_recv() all the time, hence we need to reset the flags, otherwise it may end up being set forever.
Change-Id: Id358140db82b018e3973111e530834589c0b7224 --- M src/stream.c 1 file changed, 1 insertion(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/src/stream.c b/src/stream.c index 31aecc4..78238b6 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1473,6 +1473,7 @@
ret = sctp_recvmsg(fd, msgb_data(msg), msgb_tailroom(msg), NULL, NULL, &sinfo, &flags); + msgb_sctp_msg_flags(msg) = 0; 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);