pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39766?usp=email )
Change subject: sccp: Use protoClass 0 to transmit SSA
......................................................................
sccp: Use protoClass 0 to transmit SSA
Recent commit added the possibility to set proto Class 0 vs 1 based on
Sequence Control parameter present in UNITDATA.req, but forgot to extend
it to the special code path used tro transmit SSA.
As a result, libosmo-sigtran started transmitting SSA with protoClass 1
instead of previous 0. This is actually not bad, but there's no need to
use protocClass1 here since we don't care about other messages being
sent together with this one, so protoClass0 is better fit here.
Fixes: 0061e8d0bcba3b0ed5ea255588619627d0975380
Change-Id: I906094a14be670e665ed8ffd0383dd8da690cb9a
---
M src/sccp_scmg.c
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/66/39766/1
diff --git a/src/sccp_scmg.c b/src/sccp_scmg.c
index a8ac766..755d272 100644
--- a/src/sccp_scmg.c
+++ b/src/sccp_scmg.c
@@ -166,7 +166,7 @@
};
static int sccp_scmg_tx(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr,
- const struct osmo_sccp_addr *called_addr,
+ const struct osmo_sccp_addr *called_addr, const uint32_t *seq_ctrl,
uint8_t msg_type, uint8_t ssn, uint16_t pc, uint8_t smi, uint8_t *ssc_cong_lvl)
{
struct msgb *msg = sccp_msgb_alloc(__func__);
@@ -179,6 +179,7 @@
param = &prim->u.unitdata;
memcpy(¶m->calling_addr, calling_addr, sizeof(*calling_addr));
memcpy(¶m->called_addr, called_addr, sizeof(*called_addr));
+ param->in_sequence_control = seq_ctrl ? *seq_ctrl : OSMO_SCU_UNITDATA_REQ_P_SEQUENCE_CONTROL_NOT_PRESENT;
osmo_prim_init(&prim->oph, SCCP_SAP_USER, OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_REQUEST, msg);
/* Fill the actual SCMG message */
@@ -243,7 +244,7 @@
if (0 /* !subsys_available(scu) */)
return 0;
- return sccp_scmg_tx(scu, called_addr, calling_addr, SCCP_SCMG_MSGT_SSA,
+ return sccp_scmg_tx(scu, called_addr, calling_addr, NULL, SCCP_SCMG_MSGT_SSA,
sst->affected_ssn, sst->affected_pc, 0, NULL);
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39766?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I906094a14be670e665ed8ffd0383dd8da690cb9a
Gerrit-Change-Number: 39766
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/39753?usp=email )
Change subject: iuup: Explicitly discard Iu-UP-DATA.req in Initialization state
......................................................................
iuup: Explicitly discard Iu-UP-DATA.req in Initialization state
Since Initialization procedure is asynchronous (need to wait for IuUP
ACK from peer), it may be that the user initializes the IuUP layer and
starts sending/forarding IuUP data to it before the initialization
finishes.
Before this patch, an error would be logged for each such Data request.
Let's instead explicitly expect this event and hence avoid logging a
generic FSM error log "{Initialisation}: Event IuUP-DATA-req not
permitted" and log in INFO level and discard the message.
Change-Id: I424be5718cdd12cfd0ce80108a002ce68d3e17aa
---
M src/gsm/iuup.c
1 file changed, 8 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, approved
diff --git a/src/gsm/iuup.c b/src/gsm/iuup.c
index 4991213..df303e5 100644
--- a/src/gsm/iuup.c
+++ b/src/gsm/iuup.c
@@ -714,6 +714,13 @@
/* the only permitted 'config req' type is the request to release the instance */
osmo_fsm_inst_state_chg(fi, IUUP_FSM_ST_NULL, 0, 0);
break;
+ case IUUP_FSM_EVT_IUUP_DATA_REQ:
+ /* Data coming down from RNL (user) towards TNL (transport).
+ * Discard since we are still not in Data Transfer Ready State. */
+ irp = data;
+ LOGPFSML(fi, LOGL_INFO, "Iu-UP-DATA.req while still initializing, discarding\n");
+ msgb_free(irp->oph.msg);
+ break;
case IUUP_FSM_EVT_INIT:
itp = data;
if (iuup_rx_initialization(iui, itp))
@@ -825,6 +832,7 @@
},
[IUUP_FSM_ST_INIT] = {
.in_event_mask = S(IUUP_FSM_EVT_IUUP_CONFIG_REQ) |
+ S(IUUP_FSM_EVT_IUUP_DATA_REQ) |
S(IUUP_FSM_EVT_INIT) |
S(IUUP_FSM_EVT_LAST_INIT_ACK) |
S(IUUP_FSM_EVT_INIT_NACK),
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39753?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I424be5718cdd12cfd0ce80108a002ce68d3e17aa
Gerrit-Change-Number: 39753
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39740?usp=email )
Change subject: mgw: Split DLCX read-only validations into its own function
......................................................................
mgw: Split DLCX read-only validations into its own function
Similar to what's already done in CRCX and MDXC.
Change-Id: I3d86f0cbeacc7c0cd69809f898714a76d3b86ed0
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 50 insertions(+), 28 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 6a731a3..237f2bf 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -1073,6 +1073,49 @@
return create_err_response(endp, endp, error_code, "MDCX", pdata->trans);
}
+/* Read-only checks for parsed DLCX request, applied to existing found conn.
+ * Returns negative MGCP error code on failure, 0 on scucess.
+ * NOTE: rq->endp may be NULL here! */
+static int validate_parsed_dlcx(struct mgcp_request_data *rq)
+{
+ struct mgcp_parse_data *pdata = rq->pdata;
+ struct mgcp_parse_hdr_pars *hpars = &pdata->hpars;
+ struct rate_ctr_group *rate_ctrs = rq->trunk->ratectr.mgcp_dlcx_ctr_group;
+ int rc;
+
+ if (hpars->callid) {
+ /* If we have no endpoint, but a call id in the request, then this request cannot be handled */
+ if (!rq->endp) {
+ LOGPTRUNK(rq->trunk, DLMGCP, LOGL_NOTICE,
+ "cannot handle requests with call-id (C) without endpoint -- abort!");
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
+ return -539;
+ }
+ if (!(rq->endp->x_osmo_ign & MGCP_X_OSMO_IGN_CALLID) &&
+ mgcp_verify_call_id(rq->endp, hpars->callid) != 0) {
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CALLID));
+ return -516;
+ }
+ }
+
+ if (hpars->connid) {
+ /* If we have no endpoint, but a connection id in the request, then this request cannot be handled */
+ if (!rq->endp) {
+ LOGPTRUNK(rq->trunk, DLMGCP, LOGL_NOTICE,
+ "cannot handle requests with conn-id (I) without endpoint -- abort!");
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
+ return -539;
+ }
+ if ((rc = mgcp_verify_ci(rq->endp, hpars->connid)) != 0) {
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CONNID));
+ return -rc;
+ }
+ }
+
+ /* Everything fine, continue */
+ return 0;
+}
+
/* DLCX command handler, processes the received command */
static struct msgb *handle_delete_con(struct mgcp_request_data *rq)
{
@@ -1130,39 +1173,18 @@
if (rc < 0)
return create_err_response(rq->trunk, NULL, -rc, "DLCX", pdata->trans);
- if (hpars->callid) {
- /* If we have no endpoint, but a call id in the request, then this request cannot be handled */
- if (!endp) {
- LOGPTRUNK(trunk, DLMGCP, LOGL_NOTICE,
- "cannot handle requests with call-id (C) without endpoint -- abort!");
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
- return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans);
- }
- if (!(endp->x_osmo_ign & MGCP_X_OSMO_IGN_CALLID) &&
- mgcp_verify_call_id(endp, hpars->callid) != 0) {
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CALLID));
- return create_err_response(endp, endp, 516, "DLCX", pdata->trans);
- }
- }
-
- if (hpars->connid) {
- /* If we have no endpoint, but a connection id in the request, then this request cannot be handled */
- if (!endp) {
- LOGPTRUNK(trunk, DLMGCP, LOGL_NOTICE,
- "cannot handle requests with conn-id (I) without endpoint -- abort!");
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
- return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans);
- }
- if ((rc = mgcp_verify_ci(endp, hpars->connid)) != 0) {
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CONNID));
- return create_err_response(endp, endp, rc, "DLCX", pdata->trans);
- }
- }
+ rc = validate_parsed_dlcx(rq);
+ if (rc < 0)
+ return create_err_response(rq->trunk, NULL, -rc, "DLCX", pdata->trans);
/* The logic does not permit to go past this point without having the
* the endp pointer populated. */
OSMO_ASSERT(endp);
+ /*****************************************************************************
+ * From here on below we start, delete conn and potentially release endpoint.
+ *****************************************************************************/
+
/* When no connection id is supplied, we will interpret this as a
* wildcarded DLCX that refers to the selected endpoint. This means
* that we drop all connections on that specific endpoint at once.
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39740?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I3d86f0cbeacc7c0cd69809f898714a76d3b86ed0
Gerrit-Change-Number: 39740
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39754?usp=email )
Change subject: mgw: CRCX: Handle codec information before initializing osmux
......................................................................
mgw: CRCX: Handle codec information before initializing osmux
Same order as done during MDCX. This way we can also eg. check
configured codec is AMR before successfully entering configuring osmux.
Change-Id: If291db0c048196e6e0eee2c38e648e5a25438078
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 10 insertions(+), 8 deletions(-)
Approvals:
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 237f2bf..ef82796 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -768,6 +768,15 @@
conn_rtp = mgcp_conn_get_conn_rtp(conn);
OSMO_ASSERT(conn_rtp);
+ /* Handle codec information and decide for a suitable codec */
+ rc = handle_codec_info(conn_rtp, rq);
+ mgcp_codecset_summary(&conn_rtp->end.cset, mgcp_conn_dump(conn));
+ if (rc) {
+ error_code = rc;
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_CODEC_NEGOTIATION));
+ goto error2;
+ }
+
/* If X-Osmux (remote CID) was received, alloc next avail CID as local CID */
if (hpars->remote_osmux_cid != MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET) {
/* Make sure osmux is setup: */
@@ -785,14 +794,6 @@
} /* else: -1 (wildcard) */
}
- /* Handle codec information and decide for a suitable codec */
- rc = handle_codec_info(conn_rtp, rq);
- mgcp_codecset_summary(&conn_rtp->end.cset, mgcp_conn_dump(conn));
- if (rc) {
- error_code = rc;
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_CODEC_NEGOTIATION));
- goto error2;
- }
/* Upgrade the conn type RTP_DEFAULT->RTP_IUUP if needed based on requested codec: */
if (conn_rtp->type == MGCP_RTP_DEFAULT &&
strcmp(conn_rtp->end.cset.codec->subtype_name, "VND.3GPP.IUFP") == 0) {
@@ -1017,6 +1018,7 @@
error_code = rc;
goto error3;
}
+
/* Upgrade the conn type RTP_DEFAULT->RTP_IUUP if needed based on requested codec: */
if (conn_rtp->type == MGCP_RTP_DEFAULT &&
strcmp(conn_rtp->end.cset.codec->subtype_name, "VND.3GPP.IUFP") == 0)
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39754?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: If291db0c048196e6e0eee2c38e648e5a25438078
Gerrit-Change-Number: 39754
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>