vlr_auth_fsm: on SAI use the GSUP provided GMM cause code

The HLR might respond with a specific GMM cause code. E.g. roaming not
allowed which needs to be passed down the layers.

Change-Id: I9af515dc52834b7c57c42fc3a76ee2c682734e2a
This commit is contained in:
Alexander Couzens 2019-08-19 15:41:33 +02:00 committed by laforge
parent 7312b15830
commit a09f4987c1
1 changed files with 8 additions and 7 deletions

View File

@ -331,6 +331,7 @@ static void auth_fsm_wait_ai(struct osmo_fsm_inst *fi, uint32_t event,
struct auth_fsm_priv *afp = fi->priv;
struct vlr_subscr *vsub = afp->vsub;
struct osmo_gsup_message *gsup = data;
enum gsm48_reject_value gsm48_rej;
if (event == VLR_AUTH_E_HLR_SAI_NACK)
LOGPFSM(fi, "GSUP: rx Auth Info Error cause: %d: %s\n",
@ -350,21 +351,21 @@ static void auth_fsm_wait_ai(struct osmo_fsm_inst *fi, uint32_t event,
afp->auth_tuple_max_reuse_count = -1;
goto pass;
}
/* result = procedure error */
auth_fsm_term(fi, GSM48_REJECT_NETWORK_FAILURE);
return;
}
switch (event) {
case VLR_AUTH_E_HLR_SAI_ACK:
if (!gsup->num_auth_vectors) {
auth_fsm_term(fi, GSM48_REJECT_NETWORK_FAILURE);
return;
}
vlr_subscr_update_tuples(vsub, gsup);
goto pass;
break;
case VLR_AUTH_E_HLR_SAI_NACK:
auth_fsm_term(fi,
gsup->cause == GMM_CAUSE_IMSI_UNKNOWN?
GSM48_REJECT_IMSI_UNKNOWN_IN_HLR
: GSM48_REJECT_NETWORK_FAILURE);
case VLR_AUTH_E_HLR_SAI_ABORT:
vlr_gmm_cause_to_mm_cause(gsup->cause, &gsm48_rej);
auth_fsm_term(fi, gsm48_rej);
break;
}