Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39716?usp=email )
Change subject: mgw: Delay osmux trunk setup to point where it is really needed
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39716?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I27f7355ee99f1781fc2034a23c7cca756fb203d2
Gerrit-Change-Number: 39716
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 06 Mar 2025 17:50:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39714?usp=email )
Change subject: mgw: Early reject CRCX with X-Osmux if disabled by config
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39714?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I0245b6c02bf7a3452532e8bf0d7c33479999ce9f
Gerrit-Change-Number: 39714
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 06 Mar 2025 17:47:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39713?usp=email )
Change subject: cosmetic: Drop incorrect comment
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39713?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I773065972342b8cedc900e3d194c48775c3adb5a
Gerrit-Change-Number: 39713
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 06 Mar 2025 17:43:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39714?usp=email )
Change subject: mgw: Early reject CRCX with X-Osmux if disabled by config
......................................................................
mgw: Early reject CRCX with X-Osmux if disabled by config
This new behavior rejects the CRCX before creating a conn, simplifying
the code and also allows getting rid of the remote_osmux_cid local variable.
Change-Id: I0245b6c02bf7a3452532e8bf0d7c33479999ce9f
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 19 insertions(+), 16 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/14/39714/1
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 916a284..ce397c8 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -817,7 +817,6 @@
struct mgcp_parse_hdr_pars *hpars = &pdata->hpars;
struct rate_ctr_group *rate_ctrs;
int error_code = 400;
- int remote_osmux_cid;
struct mgcp_conn *conn = NULL;
struct mgcp_conn_rtp *conn_rtp = NULL;
char conn_name[512];
@@ -892,13 +891,22 @@
}
}
- remote_osmux_cid = hpars->remote_osmux_cid;
- /* If osmux is disabled, just skip setting it up */
- if (trunk->cfg->osmux.usage == OSMUX_USAGE_OFF)
- remote_osmux_cid = MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET;
+ /* Reject osmux if disabled by config */
+ if (trunk->cfg->osmux.usage == OSMUX_USAGE_OFF &&
+ hpars->remote_osmux_cid != MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET) {
+ LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: Request with Osmux but it is disabled by config!\n");
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX));
+ return create_err_response(endp, endp, 511, "CRCX", pdata->trans);
+ }
+ /* Reject non-osmux if required by config */
+ if (trunk->cfg->osmux.usage == OSMUX_USAGE_ONLY &&
+ hpars->remote_osmux_cid == MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET) {
+ LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: Request without Osmux but it is required by config!\n");
+ return create_err_response(endp, endp, 517, "CRCX", pdata->trans);
+ }
/* Make sure osmux is setup: */
- if (remote_osmux_cid != MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET)
+ if (hpars->remote_osmux_cid != MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET)
mgcp_trunk_osmux_init_if_needed(trunk);
/* Check if we are able to accept the creation of another connection */
@@ -970,21 +978,16 @@
conn_rtp = mgcp_conn_get_conn_rtp(conn);
OSMO_ASSERT(conn_rtp);
- /* If X-Osmux (remote CID) was received (-1 is wilcard), alloc next avail CID as local CID */
- if (remote_osmux_cid >= -1) {
+ /* 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) {
if (osmux_init_conn(conn_rtp) < 0) {
rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX));
goto error2;
}
- if (remote_osmux_cid >= 0) {
+ if (hpars->remote_osmux_cid >= 0) {
conn_rtp->osmux.remote_cid_present = true;
- conn_rtp->osmux.remote_cid = remote_osmux_cid;
- }
- } else if (endp->trunk->cfg->osmux.usage == OSMUX_USAGE_ONLY) {
- LOGPCONN(conn, DLMGCP, LOGL_ERROR,
- "CRCX: osmux only and no osmux offered\n");
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX));
- goto error2;
+ conn_rtp->osmux.remote_cid = hpars->remote_osmux_cid;
+ } /* else: -1 (wildcard) */
}
/* Set local connection options, if present */
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39714?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I0245b6c02bf7a3452532e8bf0d7c33479999ce9f
Gerrit-Change-Number: 39714
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39715?usp=email )
Change subject: mgw: Validate CallID before updating endp->x_osmo_ign
......................................................................
mgw: Validate CallID before updating endp->x_osmo_ign
This allows already starting to mark a clear line in CRCX handling
function between *read-only parsing + validation* and *read-write
allocation and update* of objects.
This in turn will allow further clean up on the second mentioned step.
Change-Id: Ia41f7383171bb24f48297456935c633536aa7b05
---
M src/libosmo-mgcp/mgcp_msg.c
M src/libosmo-mgcp/mgcp_protocol.c
2 files changed, 22 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/15/39715/1
diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index ebaa32a..2269a66 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -276,10 +276,6 @@
if (!endp)
return -1;
- /* Accept any CallID for "X-Osmo-IGN: C" */
- if (endp->x_osmo_ign & MGCP_X_OSMO_IGN_CALLID)
- return 0;
-
if (!callid)
return -1;
if (!endp->callid)
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index ce397c8..b985a1b 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -928,12 +928,14 @@
}
}
- /* Update endp->x_osmo_ign: */
- endp->x_osmo_ign |= hpars->x_osmo_ign;
-
/* Check if this endpoint already serves a call, if so, check if the
- * callids match up so that we are sure that this is our call */
- if (endp->callid && mgcp_verify_call_id(endp, hpars->callid)) {
+ * callids match up so that we are sure that this is our call.
+ * Do check only if endpoint was (or is by current CRCX) configured
+ * to explicitly ignore it ("X-Osmo-IGN: C").
+ */
+ if (endp->callid &&
+ !((endp->x_osmo_ign | hpars->x_osmo_ign) & MGCP_X_OSMO_IGN_CALLID) &&
+ mgcp_verify_call_id(endp, hpars->callid)) {
LOGPENDP(endp, DLMGCP, LOGL_ERROR,
"CRCX: already seized by other call (%s)\n",
endp->callid);
@@ -949,6 +951,14 @@
}
}
+ /*******************************************************************
+ * Allocate and update endpoint and conn.
+ * From here on below we start updating endpoing and creating conn:
+ *******************************************************************/
+
+ /* Update endp->x_osmo_ign: */
+ endp->x_osmo_ign |= hpars->x_osmo_ign;
+
if (!endp->callid) {
/* Claim endpoint resources. This will also set the callid,
* creating additional connections will only be possible if
@@ -1122,7 +1132,11 @@
return create_err_response(rq->trunk, NULL, -rc, "MDCX", pdata->trans);
}
- if (hpars->callid && mgcp_verify_call_id(endp, hpars->callid) < 0) {
+ /* If a CallID is provided during MDCX, validate (unless endp was explicitly configured to ignore it
+ * through "X-Osmo-IGN: C") that it matches the one previously set. */
+ if (hpars->callid &&
+ !(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_MDCX_FAIL_INVALID_CALLID));
return create_err_response(endp, endp, 516, "MDCX", pdata->trans);
}
@@ -1328,7 +1342,8 @@
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 (mgcp_verify_call_id(endp, hpars->callid) != 0) {
+ 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);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39715?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia41f7383171bb24f48297456935c633536aa7b05
Gerrit-Change-Number: 39715
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39713?usp=email )
Change subject: cosmetic: Drop incorrect comment
......................................................................
cosmetic: Drop incorrect comment
The writer of this commit wrongly interpreted conn->end to be an
mgcp_endpoint, but it's actually an struct mgcp_rtp_end, hence codecs
are set per connection as expected.
Change-Id: I773065972342b8cedc900e3d194c48775c3adb5a
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/13/39713/1
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 34b0111..916a284 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -1009,7 +1009,6 @@
goto error2;
}
/* Upgrade the conn type RTP_DEFAULT->RTP_IUUP if needed based on requested codec: */
- /* TODO: "codec" probably needs to be moved from endp to conn */
if (conn_rtp->type == MGCP_RTP_DEFAULT &&
strcmp(conn_rtp->end.cset.codec->subtype_name, "VND.3GPP.IUFP") == 0) {
rc = mgcp_conn_iuup_init(conn_rtp);
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39713?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I773065972342b8cedc900e3d194c48775c3adb5a
Gerrit-Change-Number: 39713
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39712?usp=email )
Change subject: AS loadsharing: show cs7 instance <0-15> route binding-table [POINT_CODE]
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39712?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I31664ca795d1a8572077f173ae95b504bc019eb3
Gerrit-Change-Number: 39712
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 06 Mar 2025 12:19:05 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39708?usp=email )
Change subject: AS loadsharing: Normal route distribution regardless of active state
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39708?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I6daf114416c69c84bdc3042efcaf2918f91c2e87
Gerrit-Change-Number: 39708
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 06 Mar 2025 12:18:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes