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
Mon Dec 17 16:35:01 UTC 2018


Max has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/38/12338/1

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 a172b47..70f5c29 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1940,7 +1940,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,
@@ -1979,7 +1979,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 87adc82..59112a7 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, "    IMSI: %s%s", vsub->imsi, VTY_NEWLINE);
 	if (vsub->tmsi != GSM_RESERVED_TMSI)
 		vty_out(vty, "    TMSI: %08X%s", vsub->tmsi,
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 83bc84b..852ec32 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");
-	V_ASSERT("LAC", vsub->lac, == 23, "%u");
+	V_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 d8167bd..70b7b1f 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");
-	V_ASSERT("LAC", vsub->lac, == 23, "%u");
+	V_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: newchange
Gerrit-Change-Id: I993ebc3e14f25e83124b6d3f8461a4b18f971f8e
Gerrit-Change-Number: 12338
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181217/f8dcf6c0/attachment.htm>


More information about the gerrit-log mailing list