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);

--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29541
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Id358140db82b018e3973111e530834589c0b7224
Gerrit-Change-Number: 29541
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-CC: neels <[email protected]>
Gerrit-MessageType: merged

Reply via email to