aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_subscriber.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-19 11:10:04 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-20 16:13:48 +0100
commitd6267d12d8bd945f219b3d2f7bf04060fe2d83bd (patch)
tree99156a4e36f626b965c72d59476bae95dfc70a63 /openbsc/src/gprs/gprs_subscriber.c
parent2585620857a3a6c17b17a65a3d9a863824b8e401 (diff)
sgsn: Add SGSN_ERROR_CAUSE_NONE and use it instead of 0
Currently an error_cause of 0 is being used to indicate normal operation. Albeit this is not a defined GMM cause, the value is not explicitly reserved. This commit adds the macro SGSN_ERROR_CAUSE_NONE and uses it for initialisation (instead of relying on talloc_zero) and comparisons. The value is set to -1 to be on the safe side. The VTY code is updated to set the error_cause when using the 'update-subscriber imsi IMSI update-location-result CAUSE' command. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gprs_subscriber.c')
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index a30729d4d..5bde6a090 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -167,6 +167,8 @@ static struct sgsn_subscriber_data *sgsn_subscriber_data_alloc(void *ctx)
sdata = talloc_zero(ctx, struct sgsn_subscriber_data);
+ sdata->error_cause = SGSN_ERROR_CAUSE_NONE;
+
for (idx = 0; idx < ARRAY_SIZE(sdata->auth_triplets); idx++)
sdata->auth_triplets[idx].key_seq = GSM_KEY_SEQ_INVAL;
@@ -292,7 +294,7 @@ static int gprs_subscr_handle_gsup_auth_res(struct gsm_subscriber *subscr,
}
sdata->auth_triplets_updated = 1;
- sdata->error_cause = 0;
+ sdata->error_cause = SGSN_ERROR_CAUSE_NONE;
gprs_subscr_update_auth_info(subscr);
@@ -322,7 +324,7 @@ static int gprs_subscr_handle_gsup_upd_loc_res(struct gsm_subscriber *subscr,
}
subscr->authorized = 1;
- subscr->sgsn_data->error_cause = 0;
+ subscr->sgsn_data->error_cause = SGSN_ERROR_CAUSE_NONE;
subscr->flags |= GPRS_SUBSCRIBER_ENABLE_PURGE;
@@ -451,7 +453,7 @@ static int gprs_subscr_handle_gsup_purge_res(struct gsm_subscriber *subscr,
LOGGSUBSCRP(LOGL_INFO, subscr, "Completing purge MS\n");
/* Force silent cancellation */
- subscr->sgsn_data->error_cause = 0;
+ subscr->sgsn_data->error_cause = SGSN_ERROR_CAUSE_NONE;
gprs_subscr_put_and_cancel(subscr_get(subscr));
return 0;
@@ -500,7 +502,7 @@ static int gprs_subscr_handle_loc_cancel_req(struct gsm_subscriber *subscr,
gsup_reply.message_type = GPRS_GSUP_MSGT_LOCATION_CANCEL_RESULT;
gprs_subscr_tx_gsup_message(subscr, &gsup_reply);
- subscr->sgsn_data->error_cause = 0;
+ subscr->sgsn_data->error_cause = SGSN_ERROR_CAUSE_NONE;
gprs_subscr_put_and_cancel(subscr_get(subscr));
return 0;