diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-01-19 11:10:04 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-20 16:13:48 +0100 |
commit | d6267d12d8bd945f219b3d2f7bf04060fe2d83bd (patch) | |
tree | 99156a4e36f626b965c72d59476bae95dfc70a63 /openbsc/src/gprs/gprs_gmm.c | |
parent | 2585620857a3a6c17b17a65a3d9a863824b8e401 (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_gmm.c')
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 8b7cc9f17..32fb8e49d 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -654,7 +654,7 @@ void gsm0408_gprs_access_granted(struct sgsn_mm_ctx *ctx) void gsm0408_gprs_access_denied(struct sgsn_mm_ctx *ctx, int gmm_cause) { - if (gmm_cause == 0) + if (gmm_cause == SGSN_ERROR_CAUSE_NONE) gmm_cause = GMM_CAUSE_GPRS_NOTALLOWED; switch (ctx->mm_state) { @@ -690,7 +690,7 @@ void gsm0408_gprs_access_denied(struct sgsn_mm_ctx *ctx, int gmm_cause) void gsm0408_gprs_access_cancelled(struct sgsn_mm_ctx *ctx, int gmm_cause) { - if (gmm_cause != 0) { + if (gmm_cause != SGSN_ERROR_CAUSE_NONE) { LOGMMCTXP(LOGL_INFO, ctx, "Cancelled with cause '%s' (%d), deleting context\n", get_value_string(gsm48_gmm_cause_names, gmm_cause), |