diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index b1c0d5dde..56314b747 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -113,7 +113,6 @@ struct sgsn_mm_ctx; struct vlr_instance; #define VLR_NAME_LENGTH 160 -#define VLR_MSISDN_LENGTH 15 /* The VLR subscriber is the part of the GSM subscriber state in VLR (CS) or * SGSN (PS), particularly while interacting with the HLR via GSUP */ @@ -127,7 +126,7 @@ struct vlr_subscr { /* Data from HLR */ /* 3GPP TS 23.008 */ /* Always use vlr_subscr_set_imsi() to write to imsi[] */ char imsi[GSM23003_IMSI_MAX_DIGITS+1]; /* 2.1.1.1 */ - char msisdn[VLR_MSISDN_LENGTH+1]; /* 2.1.2 */ + char msisdn[GSM23003_MSISDN_MAX_DIGITS+1]; /* 2.1.2 */ char name[VLR_NAME_LENGTH+1]; /* proprietary */ OSMO_LBUF_DECL(hlr, 16); /* 2.4.7 */ uint32_t periodic_lu_timer; /* 2.4.24 */ diff --git a/src/libmsc/msc_t.c b/src/libmsc/msc_t.c index 8eefccc71..6b96c26ca 100644 --- a/src/libmsc/msc_t.c +++ b/src/libmsc/msc_t.c @@ -75,7 +75,7 @@ static int msc_t_assign_handover_number(struct msc_t *msc_t) int rc; uint64_t started_at; uint64_t ho_nr; - char ho_nr_str[VLR_MSISDN_LENGTH+1]; + char ho_nr_str[GSM23003_MSISDN_MAX_DIGITS+1]; struct gsm_network *net = msc_t_net(msc_t); bool usable = false; @@ -417,7 +417,7 @@ static int msc_t_patch_and_send_ho_request_ack(struct msc_t *msc_t, const struct struct rtp_stream *rtp_cn = msc_t->inter_msc.call_leg? msc_t->inter_msc.call_leg->rtp[RTP_TO_CN] : NULL; /* Since it's BCD, it needs rounded-up half the char* length of an MSISDN plus a type byte. * But no need to introduce obscure math to save a few stack bytes, just have more. */ - uint8_t msisdn_enc_buf[VLR_MSISDN_LENGTH + 1]; + uint8_t msisdn_enc_buf[GSM23003_MSISDN_MAX_DIGITS+1]; /* Copy an_apdu and an_apdu->e_info in "copy-on-write" method, because they are const and we * need to add the Handover Number to e_info. */ const struct ran_handover_request_ack *r = &ran_dec->handover_request_ack; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 2c380b294..6346c1d43 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -66,7 +66,7 @@ struct gsm_sms_queue { struct llist_head pending_sms; - char last_msisdn[VLR_MSISDN_LENGTH+1]; + char last_msisdn[GSM23003_MSISDN_MAX_DIGITS+1]; }; static int sms_subscr_cb(unsigned int, unsigned int, void *, void *); diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c index 25fc3122a..4918be233 100644 --- a/tests/sms_queue/sms_queue_test.c +++ b/tests/sms_queue/sms_queue_test.c @@ -158,7 +158,7 @@ void show_fake_sms_db() static void test_next_sms() { int i; - char last_msisdn[VLR_MSISDN_LENGTH+1] = ""; + char last_msisdn[GSM23003_MSISDN_MAX_DIGITS+1] = ""; printf("Testing smsq_take_next_sms()\n");