laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36474?usp=email )


Change subject: generalize hnbgw_tx_ue_register_rej_tmsi() to 
hnbgw_tx_ue_register_rej()
......................................................................

generalize hnbgw_tx_ue_register_rej_tmsi() to hnbgw_tx_ue_register_rej()

This way the caller can provide the cause value to be used during
reject.

Requires: osmo-iuh I7db92b51847c282d23d568970dfd2bedecdea486
Change-Id: Ic83674523c0326a7ae51fb176bddfd6641ed3ac4
---
M src/osmo-hnbgw/hnbgw_hnbap.c
1 file changed, 26 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/74/36474/1

diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c
index b2ff911..d17bd5c 100644
--- a/src/osmo-hnbgw/hnbgw_hnbap.c
+++ b/src/osmo-hnbgw/hnbgw_hnbap.c
@@ -161,7 +161,7 @@
        return hnbgw_hnbap_tx(ue->hnb, msg);
 }

-static int hnbgw_tx_ue_register_rej_tmsi(struct hnb_context *hnb, 
HNBAP_UE_Identity_t *ue_id)
+static int hnbgw_tx_ue_register_rej(struct hnb_context *hnb, 
HNBAP_UE_Identity_t *ue_id, const struct HNBAP_Cause *cause)
 {
        HNBAP_UERegisterReject_t reject_out;
        HNBAP_UERegisterRejectIEs_t reject;
@@ -229,10 +229,9 @@
                return -1;
        }

-       LOGHNB(hnb, DHNBAP, LOGL_ERROR, "Rejecting UE Register Request: TMSI 
identity registration is switched off\n");
+       LOGHNB(hnb, DHNBAP, LOGL_ERROR, "Rejecting UE Register Request 
cause=%s\n", hnbap_cause_str(cause));

-       reject.cause.present = HNBAP_Cause_PR_radioNetwork;
-       reject.cause.choice.radioNetwork = 
HNBAP_CauseRadioNetwork_invalid_UE_identity;
+       reject.cause = *cause;

        memset(&reject_out, 0, sizeof(reject_out));
        rc = hnbap_encode_ueregisterrejecties(&reject_out, &reject);
@@ -527,10 +526,17 @@
                break;
        case HNBAP_UE_Identity_PR_tMSILAI:
        case HNBAP_UE_Identity_PR_pTMSIRAI:
-               if (g_hnbgw->config.hnbap_allow_tmsi)
+               if (g_hnbgw->config.hnbap_allow_tmsi) {
                        rc = hnbgw_tx_ue_register_acc_tmsi(ctx, 
&ies.uE_Identity);
-               else
-                       rc = hnbgw_tx_ue_register_rej_tmsi(ctx, 
&ies.uE_Identity);
+               } else {
+                       struct HNBAP_Cause cause = {
+                               .present = HNBAP_Cause_PR_radioNetwork,
+                               .choice = {
+                                       .radioNetwork = 
HNBAP_CauseRadioNetwork_invalid_UE_identity,
+                               },
+                       };
+                       rc = hnbgw_tx_ue_register_rej(ctx, &ies.uE_Identity, 
&cause);
+               }
                /* all has been handled by TMSI, skip the IMSI code below */
                goto free_and_return_rc;
        default:

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

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ic83674523c0326a7ae51fb176bddfd6641ed3ac4
Gerrit-Change-Number: 36474
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-MessageType: newchange

Reply via email to