aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/src/gprs/gprs_gsup_messages.c4
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c11
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c5
3 files changed, 11 insertions, 9 deletions
diff --git a/openbsc/src/gprs/gprs_gsup_messages.c b/openbsc/src/gprs/gprs_gsup_messages.c
index f47ad5545..1dad74ffe 100644
--- a/openbsc/src/gprs/gprs_gsup_messages.c
+++ b/openbsc/src/gprs/gprs_gsup_messages.c
@@ -74,7 +74,7 @@ static int decode_pdp_info(uint8_t *data, size_t data_len,
rc = gprs_shift_tlv(&data, &data_len, &tag, &value, &value_len);
if (rc < 0)
- return rc;
+ return -GMM_CAUSE_PROTO_ERR_UNSPEC;
iei = tag;
@@ -116,7 +116,7 @@ static int decode_auth_info(uint8_t *data, size_t data_len,
while (data_len > 0) {
rc = gprs_shift_tlv(&data, &data_len, &tag, &value, &value_len);
if (rc < 0)
- return rc;
+ return -GMM_CAUSE_PROTO_ERR_UNSPEC;
iei = tag;
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index fd16fa3ef..136ac28fb 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -339,7 +339,8 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
rc = gprs_gsup_decode(data, data_len, &gsup_msg);
if (rc < 0) {
LOGP(DGPRS, LOGL_ERROR,
- "decoding GSUP message fails with error code %d\n", -rc);
+ "decoding GSUP message fails with error '%s' (%d)\n",
+ get_value_string(gsm48_gmm_cause_names, -rc), -rc);
return rc;
}
@@ -369,19 +370,19 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
break;
case GPRS_GSUP_MSGT_SEND_AUTH_INFO_RESULT:
- gprs_subscr_handle_gsup_auth_res(subscr, &gsup_msg);
+ rc = gprs_subscr_handle_gsup_auth_res(subscr, &gsup_msg);
break;
case GPRS_GSUP_MSGT_SEND_AUTH_INFO_ERROR:
- gprs_subscr_handle_gsup_auth_err(subscr, &gsup_msg);
+ rc = gprs_subscr_handle_gsup_auth_err(subscr, &gsup_msg);
break;
case GPRS_GSUP_MSGT_UPDATE_LOCATION_RESULT:
- gprs_subscr_handle_gsup_upd_loc_res(subscr, &gsup_msg);
+ rc = gprs_subscr_handle_gsup_upd_loc_res(subscr, &gsup_msg);
break;
case GPRS_GSUP_MSGT_UPDATE_LOCATION_ERROR:
- gprs_subscr_handle_gsup_upd_loc_err(subscr, &gsup_msg);
+ rc = gprs_subscr_handle_gsup_upd_loc_err(subscr, &gsup_msg);
break;
case GPRS_GSUP_MSGT_PURGE_MS_ERROR:
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index ef8661b12..6980a9015 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -28,6 +28,7 @@
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gsm/gsm_utils.h>
+#include <openbsc/gsm_04_08_gprs.h>
#include <osmocom/core/application.h>
#include <osmocom/core/msgb.h>
@@ -438,7 +439,7 @@ static void test_subscriber_gsup(void)
/* Inject SendAuthInfoErr GSUP message */
rc = rx_gsup_message(send_auth_info_err, sizeof(send_auth_info_err));
- OSMO_ASSERT(rc >= 0);
+ OSMO_ASSERT(rc == -GMM_CAUSE_GPRS_NOTALLOWED);
OSMO_ASSERT(last_updated_subscr == s1);
/* Check triplets */
@@ -456,7 +457,7 @@ static void test_subscriber_gsup(void)
/* Inject UpdateLocErr GSUP message */
rc = rx_gsup_message(update_location_err, sizeof(update_location_err));
- OSMO_ASSERT(rc >= 0);
+ OSMO_ASSERT(rc == -GMM_CAUSE_GPRS_NOTALLOWED);
OSMO_ASSERT(last_updated_subscr == s1);
/* Check authorization */