Remove redundancy in LAC processing

Always use LAC which is part of Cell Global ID otherwise we might end up
in a situation where separately stored LAC differs.

Both are described in 3GPP TS 23.008 $2.4 as temporary subscriber data
to be stored in VLR. Both are defined in 3GPP TS 23.003. The LAC is part
of LAI which is part of CGI so there should be no case when those values
differ for a given subscriber.

Change-Id: I993ebc3e14f25e83124b6d3f8461a4b18f971f8e
This commit is contained in:
Max 2018-12-19 11:48:33 +01:00
parent 2a0ac3b162
commit 7d41d870de
8 changed files with 9 additions and 11 deletions

View File

@ -142,9 +142,7 @@ struct vlr_subscr {
/* Newly allocated TMSI that was not yet acked by MS */ /* Newly allocated TMSI that was not yet acked by MS */
uint32_t tmsi_new; uint32_t tmsi_new;
/* some redundancy in information below? */
struct osmo_cell_global_id cgi; /* 2.4.16 */ struct osmo_cell_global_id cgi; /* 2.4.16 */
uint16_t lac; /* 2.4.2 */
char imeisv[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.2.3 */ char imeisv[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.2.3 */
char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.1.9 */ char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* 2.1.9 */

View File

@ -1939,7 +1939,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
GSM48_CC_CAUSE_UNASSIGNED_NR); GSM48_CC_CAUSE_UNASSIGNED_NR);
} }
/* If subscriber is not "attached" */ /* If subscriber is not "attached" */
if (!vsub->lac) { if (!vsub->cgi.lai.lac) {
DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) "
"Received '%s' from MNCC with " "Received '%s' from MNCC with "
"detached subscriber %s\n", data->called.number, "detached subscriber %s\n", data->called.number,
@ -1978,7 +1978,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
"unallocated channel, paging already " "unallocated channel, paging already "
"started for lac %d.\n", "started for lac %d.\n",
data->called.number, data->called.number,
get_mncc_name(msg_type), vsub->lac); get_mncc_name(msg_type), vsub->cgi.lai.lac);
vlr_subscr_put(vsub); vlr_subscr_put(vsub);
trans_free(trans); trans_free(trans);
return 0; return 0;

View File

@ -287,7 +287,7 @@ static struct gsm_trans *establish_nc_ss_trans(struct gsm_network *net,
} }
/* If subscriber is not "attached" */ /* If subscriber is not "attached" */
if (!vsub->lac) { if (!vsub->cgi.lai.lac) {
LOGP(DMM, LOGL_ERROR, "Network-originated session " LOGP(DMM, LOGL_ERROR, "Network-originated session "
"rejected - subscriber is not attached\n"); "rejected - subscriber is not attached\n");
return NULL; return NULL;

View File

@ -116,12 +116,12 @@ static int msc_paging_request(struct vlr_subscr *vsub)
* SCCP connections (if any). */ * SCCP connections (if any). */
switch (vsub->cs.attached_via_ran) { switch (vsub->cs.attached_via_ran) {
case RAN_GERAN_A: case RAN_GERAN_A:
return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->lac); return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->cgi.lai.lac);
case RAN_UTRAN_IU: case RAN_UTRAN_IU:
return ranap_iu_page_cs(vsub->imsi, return ranap_iu_page_cs(vsub->imsi,
vsub->tmsi == GSM_RESERVED_TMSI? vsub->tmsi == GSM_RESERVED_TMSI?
NULL : &vsub->tmsi, NULL : &vsub->tmsi,
vsub->lac); vsub->cgi.lai.lac);
default: default:
break; break;
} }

View File

@ -631,7 +631,7 @@ static void subscr_dump_full_vty(struct vty *vty, struct vlr_subscr *vsub)
vty_out(vty, " Extension: %s%s", vsub->msisdn, vty_out(vty, " Extension: %s%s", vsub->msisdn,
VTY_NEWLINE); VTY_NEWLINE);
vty_out(vty, " LAC: %d/0x%x%s", vty_out(vty, " LAC: %d/0x%x%s",
vsub->lac, vsub->lac, VTY_NEWLINE); vsub->cgi.lai.lac, vsub->cgi.lai.lac, VTY_NEWLINE);
vty_out(vty, " RAN: %s%s", vty_out(vty, " RAN: %s%s",
ran_type_name(vsub->cs.attached_via_ran), VTY_NEWLINE); ran_type_name(vsub->cs.attached_via_ran), VTY_NEWLINE);
vty_out(vty, " IMSI: %s%s", vsub->imsi, VTY_NEWLINE); vty_out(vty, " IMSI: %s%s", vsub->imsi, VTY_NEWLINE);

View File

@ -950,7 +950,7 @@ static int assoc_lfp_with_sub(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub)
vsub->lu_fsm = fi; vsub->lu_fsm = fi;
vsub->msc_conn_ref = lfp->msc_conn_ref; vsub->msc_conn_ref = lfp->msc_conn_ref;
/* FIXME: send new LAC to HLR? */ /* FIXME: send new LAC to HLR? */
vsub->lac = lfp->new_lai.lac; vsub->cgi.lai.lac = lfp->new_lai.lac;
lfp->vsub = vsub; lfp->vsub = vsub;
/* Tell MSC to associate this subscriber with the given /* Tell MSC to associate this subscriber with the given
* connection */ * connection */

View File

@ -154,7 +154,7 @@ static void standard_lu()
vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI); vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI);
VERBOSE_ASSERT(vsub != NULL, == true, "%d"); VERBOSE_ASSERT(vsub != NULL, == true, "%d");
VERBOSE_ASSERT(strcmp(vsub->imsi, IMSI), == 0, "%d"); VERBOSE_ASSERT(strcmp(vsub->imsi, IMSI), == 0, "%d");
VAL_ASSERT("LAC", vsub->lac, == 23, "%u"); VAL_ASSERT("LAC", vsub->cgi.lai.lac, == 23, "%u");
vlr_subscr_put(vsub); vlr_subscr_put(vsub);
} }

View File

@ -68,7 +68,7 @@ static void perform_lu(void)
vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI); vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI);
VERBOSE_ASSERT(vsub != NULL, == true, "%d"); VERBOSE_ASSERT(vsub != NULL, == true, "%d");
VERBOSE_ASSERT(strcmp(vsub->imsi, IMSI), == 0, "%d"); VERBOSE_ASSERT(strcmp(vsub->imsi, IMSI), == 0, "%d");
VAL_ASSERT("LAC", vsub->lac, == 23, "%u"); VAL_ASSERT("LAC", vsub->cgi.lai.lac, == 23, "%u");
vlr_subscr_put(vsub); vlr_subscr_put(vsub);
bss_sends_clear_complete(); bss_sends_clear_complete();