pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/37807?usp=email )

Change subject: on RUA Connect failure, respond with RUA Disconnect
......................................................................

on RUA Connect failure, respond with RUA Disconnect

Related: OS#6283
Related: osmo-ttcn3-hacks I2b5c024a395e736538c0c37db40d34f3b8d99991
Tweaked-by: Oliver Smith <[email protected]>
Change-Id: Iafb30c31a4c5db53ecdda99a0e0b5937b71e362c
---
M src/osmo-hnbgw/hnbgw_rua.c
1 file changed, 15 insertions(+), 0 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve




diff --git a/src/osmo-hnbgw/hnbgw_rua.c b/src/osmo-hnbgw/hnbgw_rua.c
index 5576fa4..01e9e3a 100644
--- a/src/osmo-hnbgw/hnbgw_rua.c
+++ b/src/osmo-hnbgw/hnbgw_rua.c
@@ -166,6 +166,20 @@
        return hnbgw_rua_tx(hnb, msg);
 }

+/* Send Disconnect to RUA without RANAP data */
+static void rua_tx_disc_conn_fail(struct hnb_context *hnb, bool is_ps, 
uint32_t context_id)
+{
+       RUA_Cause_t rua_cause = {
+               .present = RUA_Cause_PR_radioNetwork,
+               .choice.radioNetwork = RUA_CauseRadioNetwork_connect_failed,
+       };
+
+       LOG_HNBP(hnb->persistent, LOGL_INFO, "Tx RUA Disconnect\n");
+
+       if (rua_tx_disc(hnb, is_ps, context_id, &rua_cause, NULL, 0))
+               LOG_HNBP(hnb->persistent, LOGL_ERROR, "Failed to send 
Disconnect to RUA\n");
+}
+
 static struct value_string rua_procedure_code_names[] = {
        { RUA_ProcedureCode_id_Connect, "Connect" },
        { RUA_ProcedureCode_id_DirectTransfer, "DirectTransfer" },
@@ -270,6 +284,7 @@
                        LOGHNB(hnb, DRUA, LOGL_ERROR,
                               "Failed to create context map for %s: rx RUA %s 
with %u bytes RANAP data\n",
                               is_ps ? "IuPS" : "IuCS", 
rua_procedure_code_name(rua_procedure), data ? len : 0);
+                       rua_tx_disc_conn_fail(hnb, is_ps, context_id);
                        return -EINVAL;
                }
                break;

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/37807?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Iafb30c31a4c5db53ecdda99a0e0b5937b71e362c
Gerrit-Change-Number: 37807
Gerrit-PatchSet: 3
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-CC: osmith <[email protected]>

Reply via email to