aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-07-13 11:33:18 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-08-08 16:04:04 +0200
commitaecf85705cb59ca4a2ba4f35530f3375e0c84e64 (patch)
tree64b3d908b509ced47c4bcef99d66eb508e8682cc
parent1c98031203fa003f5acc80f8527e9427429ee416 (diff)
Tx Loc UPD ACC: Use PLMN provided by subscr
The MS in general provides the Selected PLMN ID (IE) in the Complete Layer 3 Information message. osmo-msc handles that message in msc_a_ran_dec_from_msc_i() and stores the information of the PLMN in msc_a->via_cell. If no PLMN information is provided in the message, then at that same place the PLMN configured in the VTY is taken as an implicit default. The PLMN information stored in msc_a->via_cell is then finally stored into vsub->cgi in evaluate_acceptance_outcome(). This patch changes gsm0408_loc_upd_acc() to avoid re-applying the PLMN configured at the VTY again, and instead use whatever is already in vsub->cgi. This is more correct since the PLMN provided by the MS takes precedence over the implicitly configured one, meaning several PLMNs can be handled. Otherwise, the code is always overwriting the PLMN announced by the network on a specific RAN with the one in the MSC, which may end up with unexpected results. Related: SYS#6360 Change-Id: I421bd63a264db2bf6e1c4a4eea976f389e87b332
-rw-r--r--src/libmsc/gsm_04_08.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index fc82d780a..70faf95bc 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -120,12 +120,7 @@ static int gsm0408_loc_upd_acc(struct msc_a *msc_a, uint32_t send_tmsi)
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD ACC");
struct gsm48_hdr *gh;
struct gsm48_loc_area_id *lai;
- struct gsm_network *net = msc_a_net(msc_a);
struct vlr_subscr *vsub = msc_a_vsub(msc_a);
- struct osmo_location_area_id laid = {
- .plmn = net->plmn,
- .lac = vsub->cgi.lai.lac,
- };
uint8_t *l;
int rc;
struct osmo_mobile_identity mi = {};
@@ -135,7 +130,7 @@ static int gsm0408_loc_upd_acc(struct msc_a *msc_a, uint32_t send_tmsi)
gh->msg_type = GSM48_MT_MM_LOC_UPD_ACCEPT;
lai = (struct gsm48_loc_area_id *) msgb_put(msg, sizeof(*lai));
- gsm48_generate_lai2(lai, &laid);
+ gsm48_generate_lai2(lai, &vsub->cgi.lai);
if (send_tmsi == GSM_RESERVED_TMSI) {
/* we did not allocate a TMSI to the MS, so we need to