pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-netif/+/29540 )
Change subject: stream: Set proper msgb length when returning sctp_notification
......................................................................
stream: Set proper msgb length when returning sctp_notification
This allows the user to properly check the size of the content in case
the struct ABI changes.
-EAGAIN is still returned to avoid older users of the API reading SCTP
notifications as user data.
Change-Id: I95e2457498fd8e0d790d221cb97695ace0dd673e
---
M src/stream.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/40/29540/1
diff --git a/src/stream.c b/src/stream.c
index b45b730..31aecc4 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1476,6 +1476,7 @@
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_put(msg, sizeof(union sctp_notification));
msgb_sctp_msg_flags(msg) = OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION;
switch (notif->sn_header.sn_type) {
case SCTP_ASSOC_CHANGE:
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/29540
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I95e2457498fd8e0d790d221cb97695ace0dd673e
Gerrit-Change-Number: 29540
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange