neels has submitted this change. (
https://gerrit.osmocom.org/c/osmo-hnbgw/+/33179 )
(
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: include Global RNC-ID in RESET
......................................................................
include Global RNC-ID in RESET
According to 3GPP TS 25.413 8.26.2.2, "The RNC shall include the Global
RNC-ID IE in the RESET message."
Related: SYS#6441
Change-Id: I2cd5d7ea86a6ed0916befe219dbf21373afbd95b
---
M TODO-RELEASE
M src/osmo-hnbgw/cnlink.c
2 files changed, 44 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 10cb13b..37cadc5 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -12,3 +12,4 @@
Uses osmo_scu_prim_hdr_name_c()
libosmo-mgcp-client > 1.11.0 mgcp_client_pool_empty(), mgcp_client_conf_alloc()
libosmo-sigtran >1.7.0 Require presence of vty 'cs7 instance'/'sccp
max-optional-data' that the deprecated+fatal 'hnbgw'/'sccp cr...'
tells the user to use instead.
+libosmo-ranap >1.4.0 ranap_new_msg_reset2()
diff --git a/src/osmo-hnbgw/cnlink.c b/src/osmo-hnbgw/cnlink.c
index c98d713..1b4af7f 100644
--- a/src/osmo-hnbgw/cnlink.c
+++ b/src/osmo-hnbgw/cnlink.c
@@ -25,6 +25,7 @@
#include <osmocom/sigtran/sccp_helpers.h>
+#include <asn1c/asn1helpers.h>
#include <osmocom/ranap/ranap_ies_defs.h>
#include <osmocom/ranap/ranap_msg_factory.h>
@@ -127,6 +128,9 @@
.present = RANAP_Cause_PR_transmissionNetwork,
.choice. transmissionNetwork =
RANAP_CauseTransmissionNetwork_signalling_transport_resource_failure,
};
+ RANAP_GlobalRNC_ID_t grnc_id;
+ RANAP_GlobalRNC_ID_t *use_grnc_id = NULL;
+ uint8_t plmn_buf[3];
if (!cnlink)
return;
@@ -144,7 +148,32 @@
cnlink_is_cs(cnlink) ? "IuCS" : "IuPS",
cnlink_sccp_addr_to_str(cnlink, &cnlink->remote_addr));
- msg = ranap_new_msg_reset(cnlink->pool->domain, &cause);
+ if (g_hnbgw->config.plmn.mcc) {
+ osmo_plmn_to_bcd(plmn_buf, &g_hnbgw->config.plmn);
+ grnc_id = (RANAP_GlobalRNC_ID_t){
+ .pLMNidentity = {
+ .buf = plmn_buf,
+ .size = 3,
+ },
+ .rNC_ID = g_hnbgw->config.rnc_id,
+ };
+ use_grnc_id = &grnc_id;
+ } else {
+ /* If no PLMN is configured, omit the Global RNC Id from the RESET message.
+ *
+ * According to 3GPP TS 25.413 8.26.2.2, "The RNC shall include the Global RNC-ID
IE in the RESET
+ * message", so it should be considered a mandatory IE when coming from us, the
RNC.
+ *
+ * But osmo-hnbgw < v1.5 worked well with osmo-hnbgw.cfg files that have no PLMN
configured, and we are
+ * trying to stay backwards compatible for those users. Such a site should still work,
but they should
+ * now see these error logs and can adjust the config.
+ */
+ LOG_CNLINK(cnlink, DRANAP, LOGL_ERROR,
+ "No local PLMN is configured, so outgoing RESET messages omit the mandatory
Global RNC-ID"
+ " IE. You should set a 'hnbgw' / 'plmn' in your config file
(since v1.5)\n");
+ }
+
+ msg = ranap_new_msg_reset2(cnlink->pool->domain, &cause, use_grnc_id);
osmo_sccp_tx_unitdata_msg(cnlink->hnbgw_sccp_user->sccp_user,
&cnlink->hnbgw_sccp_user->local_addr,
--
To view, visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/33179
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I2cd5d7ea86a6ed0916befe219dbf21373afbd95b
Gerrit-Change-Number: 33179
Gerrit-PatchSet: 8
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged