Change in osmo-msc[master]: Remove redundancy in LAC processing

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Wed Dec 19 10:56:23 UTC 2018


Max has submitted this change and it was merged. ( https://gerrit.osmocom.org/12338 )

Change subject: Remove redundancy in LAC processing
......................................................................

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
---
M include/osmocom/msc/vlr.h
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/gsm_09_11.c
M src/libmsc/gsm_subscriber.c
M src/libmsc/msc_vty.c
M src/libvlr/vlr_lu_fsm.c
M tests/msc_vlr/msc_vlr_test_call.c
M tests/msc_vlr/msc_vlr_test_ss.c
8 files changed, 9 insertions(+), 11 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Max: Looks good to me, approved



diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h
index 2f31063..20a9c0f 100644
--- a/include/osmocom/msc/vlr.h
+++ b/include/osmocom/msc/vlr.h
@@ -142,9 +142,7 @@
 	/* Newly allocated TMSI that was not yet acked by MS */
 	uint32_t tmsi_new;
 
-	/* some redundancy in information below? */
 	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 imei[GSM23003_IMEISV_NUM_DIGITS+1];	/* 2.1.9 */
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 5500f6f..5567da9 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1939,7 +1939,7 @@
 						GSM48_CC_CAUSE_UNASSIGNED_NR);
 		}
 		/* If subscriber is not "attached" */
-		if (!vsub->lac) {
+		if (!vsub->cgi.lai.lac) {
 			DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) "
 				"Received '%s' from MNCC with "
 				"detached subscriber %s\n", data->called.number,
@@ -1978,7 +1978,7 @@
 					"unallocated channel, paging already "
 					"started for lac %d.\n",
 					data->called.number,
-					get_mncc_name(msg_type), vsub->lac);
+					get_mncc_name(msg_type), vsub->cgi.lai.lac);
 				vlr_subscr_put(vsub);
 				trans_free(trans);
 				return 0;
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 43bf48c..3ee6e92 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -287,7 +287,7 @@
 	}
 
 	/* If subscriber is not "attached" */
-	if (!vsub->lac) {
+	if (!vsub->cgi.lai.lac) {
 		LOGP(DMM, LOGL_ERROR, "Network-originated session "
 			"rejected - subscriber is not attached\n");
 		return NULL;
diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c
index 188807e..0e76efc 100644
--- a/src/libmsc/gsm_subscriber.c
+++ b/src/libmsc/gsm_subscriber.c
@@ -116,12 +116,12 @@
 	 * SCCP connections (if any). */
 	switch (vsub->cs.attached_via_ran) {
 	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:
 		return ranap_iu_page_cs(vsub->imsi,
 					vsub->tmsi == GSM_RESERVED_TMSI?
 					NULL : &vsub->tmsi,
-					vsub->lac);
+					vsub->cgi.lai.lac);
 	default:
 		break;
 	}
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 5622c02..3079bc3 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -631,7 +631,7 @@
 		vty_out(vty, "    Extension: %s%s", vsub->msisdn,
 			VTY_NEWLINE);
 	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",
 		ran_type_name(vsub->cs.attached_via_ran), VTY_NEWLINE);
 	vty_out(vty, "    IMSI: %s%s", vsub->imsi, VTY_NEWLINE);
diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c
index 5d171d5..e635305 100644
--- a/src/libvlr/vlr_lu_fsm.c
+++ b/src/libvlr/vlr_lu_fsm.c
@@ -950,7 +950,7 @@
 	vsub->lu_fsm = fi;
 	vsub->msc_conn_ref = lfp->msc_conn_ref;
 	/* FIXME: send new LAC to HLR? */
-	vsub->lac = lfp->new_lai.lac;
+	vsub->cgi.lai.lac = lfp->new_lai.lac;
 	lfp->vsub = vsub;
 	/* Tell MSC to associate this subscriber with the given
 	 * connection */
diff --git a/tests/msc_vlr/msc_vlr_test_call.c b/tests/msc_vlr/msc_vlr_test_call.c
index 4a4f243..b1ff2c0 100644
--- a/tests/msc_vlr/msc_vlr_test_call.c
+++ b/tests/msc_vlr/msc_vlr_test_call.c
@@ -154,7 +154,7 @@
 	vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI);
 	VERBOSE_ASSERT(vsub != NULL, == true, "%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);
 }
 
diff --git a/tests/msc_vlr/msc_vlr_test_ss.c b/tests/msc_vlr/msc_vlr_test_ss.c
index 4e8077e..832293c 100644
--- a/tests/msc_vlr/msc_vlr_test_ss.c
+++ b/tests/msc_vlr/msc_vlr_test_ss.c
@@ -68,7 +68,7 @@
 	vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI);
 	VERBOSE_ASSERT(vsub != NULL, == true, "%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);
 
 	bss_sends_clear_complete();

-- 
To view, visit https://gerrit.osmocom.org/12338
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I993ebc3e14f25e83124b6d3f8461a4b18f971f8e
Gerrit-Change-Number: 12338
Gerrit-PatchSet: 4
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Stefan Sperling <stsp at stsp.name>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181219/e7af8b3b/attachment.htm>


More information about the gerrit-log mailing list