diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-05-17 20:58:40 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-05-24 12:32:23 +0800 |
commit | 10c0f56a0e109054a480d4affcde73dc6affbb56 (patch) | |
tree | 8afbff61ed707837317069d5994eda61a6703dc3 /openbsc/src | |
parent | 0bb5674cde008af942a0bfaefc9855b09117df34 (diff) |
gsup: Copy the hlr-Number and use it during purge
Copy the hlr-Number into the sgsn_data and use it during
the purgeMS. There is no unit test that looks at the data
we send so I manually verified this by looking at the output.
Below is the output of the test that purges the subscriber.
<000f> gprs_subscriber.c:170 SUBSCR(123456789012345) Sending GSUP, will send: 0c 01 08 21 43 65 87 09 21 43 f5 09 07 91 83 61 26 31 23 f3
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/gprs/gprs_subscriber.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c index c2a3ae184..8231e8cd8 100644 --- a/openbsc/src/gprs/gprs_subscriber.c +++ b/openbsc/src/gprs/gprs_subscriber.c @@ -276,6 +276,18 @@ static void gprs_subscr_gsup_insert_data(struct gsm_subscriber *subscr, } } + if (gsup_msg->hlr_enc) { + if (gsup_msg->hlr_enc_len > sizeof(sdata->hlr)) { + LOGP(DGPRS, LOGL_ERROR, "HLR-Number too long (%zu)\n", + gsup_msg->hlr_enc_len); + sdata->hlr_len = 0; + } else { + memcpy(sdata->hlr, gsup_msg->hlr_enc, + gsup_msg->hlr_enc_len); + sdata->hlr_len = gsup_msg->hlr_enc_len; + } + } + if (gsup_msg->pdp_info_compl) { rc = gprs_subscr_pdp_data_clear(subscr); if (rc > 0) @@ -666,11 +678,17 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg) int gprs_subscr_purge(struct gsm_subscriber *subscr) { + struct sgsn_subscriber_data *sdata = subscr->sgsn_data; struct gprs_gsup_message gsup_msg = {0}; LOGGSUBSCRP(LOGL_INFO, subscr, "purging MS subscriber\n"); gsup_msg.message_type = GPRS_GSUP_MSGT_PURGE_MS_REQUEST; + + /* Provide the HLR number in case it is known */ + gsup_msg.hlr_enc_len = sdata->hlr_len; + gsup_msg.hlr_enc = sdata->hlr; + return gprs_subscr_tx_gsup_message(subscr, &gsup_msg); } |