aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-09-30 14:09:32 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2022-09-30 14:09:34 +0200
commit5dd81f3c63ece4fdb225e570e0158dbaefbe3a24 (patch)
tree928940f7a835e1f2dc56176c6f9183447d81506c /src/stream.c
parent56f20d419204994d21400bad1e7338d8a7275e4e (diff)
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
Diffstat (limited to 'src/stream.c')
-rw-r--r--src/stream.c1
1 files changed, 1 insertions, 0 deletions
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 @@ static int _sctp_recvmsg_wrapper(int fd, struct msgb *msg)
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);