[PATCH] libosmo-sccp[master]: M3UA: Ensure XFER messages are not sent on stream 0

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Apr 9 19:31:09 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/2275

to look at the new patch set (#4).

M3UA: Ensure XFER messages are not sent on stream 0

According to the RFC, Stream ID 0 MUST not be used for XFER/DATA
messages.

This was discovered (and fix validated) using m3ua-sgp-mtr-v-003-alternate
of Michale Tuexen's m3ua-testtool.

Change-Id: I80b941426b5106e091bd1becff0ae97958aff97c
---
M src/m3ua.c
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/75/2275/4

diff --git a/src/m3ua.c b/src/m3ua.c
index 14df269..c29ed00 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -432,6 +432,10 @@
 		return -1;
 	}
 
+	if (xua->hdr.msg_class == M3UA_MSGC_XFER)
+		msgb_sctp_stream(msg) = 1;
+	else
+		msgb_sctp_stream(msg) = 0;
 	msgb_sctp_ppid(msg) = M3UA_PPID;
 	return osmo_ss7_asp_send(asp, msg);
 }
@@ -666,12 +670,16 @@
 		goto out;
 	}
 
-	/* TODO: check for SCTP Strema ID */
 	/* TODO: check if any AS configured in ASP */
 	/* TODO: check for valid routing context */
 
 	switch (xua->hdr.msg_class) {
 	case M3UA_MSGC_XFER:
+		/* The DATA message MUST NOT be sent on stream 0. */
+		if (msgb_sctp_stream(msg) == 0) {
+			rc = M3UA_ERR_INVAL_STREAM_ID;
+			break;
+		}
 		rc = m3ua_rx_xfer(asp, xua);
 		break;
 	case M3UA_MSGC_ASPSM:

-- 
To view, visit https://gerrit.osmocom.org/2275
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I80b941426b5106e091bd1becff0ae97958aff97c
Gerrit-PatchSet: 4
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list