neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/33179 )
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, 32 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/79/33179/1
diff --git a/TODO-RELEASE b/TODO-RELEASE index ae5d20f..33dbeb4 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() 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 e1ed757..561e5ff 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; @@ -140,7 +144,20 @@ 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 no PLMN is configured, omit the Global RNC Id from the RESET message */ + 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; + } + + 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,