Harald Welte has submitted this change and it was merged.

Change subject: sua: Reject DATA messages on SCTP stream 0
......................................................................


sua: Reject DATA messages on SCTP stream 0

RFC3868 states clearly that DATA messages MUST be sent o a stream other
than stream '0'.  So at the receiver side, we should validate that (just
like we do in M3UA.

Change-Id: I0784e221ef791557a69be04f7d246de059ea84c8
---
M src/sua.c
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/sua.c b/src/sua.c
index 881191e..3bff855 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -630,15 +630,22 @@
                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 SUA_MSGC_CL:
+               if (msgb_sctp_stream(msg) == 0) {
+                       rc = SUA_ERR_INVAL_STREAM_ID;
+                       break;
+               }
                rc = sua_rx_cl(asp, xua);
                break;
        case SUA_MSGC_CO:
+               if (msgb_sctp_stream(msg) == 0) {
+                       rc = SUA_ERR_INVAL_STREAM_ID;
+                       break;
+               }
                rc = sua_rx_co(asp, xua);
                break;
        case SUA_MSGC_ASPSM:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0784e221ef791557a69be04f7d246de059ea84c8
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to