Change in osmo-msc[master]: sgs: Use available API to set vlr subscr LastUsedEutranPLMNId

pespin gerrit-no-reply at lists.osmocom.org
Sun Jul 4 18:07:01 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/24817 )

Change subject: sgs: Use available API to set vlr subscr LastUsedEutranPLMNId
......................................................................

sgs: Use available API to set vlr subscr LastUsedEutranPLMNId

This way it's easier to find out where the vlr subscriber field is set.

Change-Id: I203de82accc896c196cb70037af89be6dc826c05
---
M src/libmsc/sgs_iface.c
1 file changed, 8 insertions(+), 6 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c
index 04302ae..9d7b6fc 100644
--- a/src/libmsc/sgs_iface.c
+++ b/src/libmsc/sgs_iface.c
@@ -915,6 +915,8 @@
 static int sgs_rx_csfb_ind(struct sgs_connection *sgc, struct msgb *msg, const struct tlv_parsed *tp, char *imsi)
 {
 	struct vlr_subscr *vsub;
+	struct osmo_plmn_id last_eutran_plmn_buf;
+	const struct osmo_plmn_id *last_eutran_plmn = &last_eutran_plmn_buf;
 
 	/* The MME informs us with this message that the UE has initiated a
 	 * service request for MO CS fallback. There is not much we can do with
@@ -928,23 +930,23 @@
 	/* 3GPP TS 23.272 sec 4.3.3 (CSFB):
 	 * "During the SGs location update procedure, obtaining the last used LTE PLMN ID via TAI"
 	 */
-	vsub->sgs.last_eutran_plmn_present = TLVP_PRES_LEN(tp, SGSAP_IE_EUTRAN_CGI, 3);
 	if (TLVP_PRES_LEN(tp, SGSAP_IE_TAI, 3)) {
-		vsub->sgs.last_eutran_plmn_present = true;
-		osmo_plmn_from_bcd(TLVP_VAL(tp, SGSAP_IE_TAI), &vsub->sgs.last_eutran_plmn);
+		osmo_plmn_from_bcd(TLVP_VAL(tp, SGSAP_IE_TAI), &last_eutran_plmn_buf);
 		/* TODO: we could also gather the TAC from here, but we don't need it yet */
 	} else if (TLVP_PRES_LEN(tp, SGSAP_IE_EUTRAN_CGI, 3)) {
 		/* Since TAI is optional, let's try harder getting Last Used
 		 * E-UTRAN PLMN ID by fetching it from E-UTRAN CGI */
-		vsub->sgs.last_eutran_plmn_present = true;
-		osmo_plmn_from_bcd(TLVP_VAL(tp, SGSAP_IE_EUTRAN_CGI), &vsub->sgs.last_eutran_plmn);
+		osmo_plmn_from_bcd(TLVP_VAL(tp, SGSAP_IE_EUTRAN_CGI), &last_eutran_plmn_buf);
 		/* TODO: we could also gather the ECI from here, but we don't need it yet */
-	} else if (!vsub->sgs.last_eutran_plmn_present) {
+	} else {
 		LOGSGC(sgc, LOGL_INFO, "Receiving SGsAP-MO-CSFB-INDICATION without TAI nor "
 		       "E-CGI IEs, and they are not known from previous SGsAP-LOCATION-UPDATE-REQUEST. "
 		       "Fast fallback GERAN->EUTRAN won't be possible!\n");
+		last_eutran_plmn = NULL;
 	}
 
+	vlr_subscr_set_last_used_eutran_plmn_id(vsub, last_eutran_plmn);
+
 	/* Check for lingering connections */
 	subscr_conn_toss(vsub);
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/24817
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I203de82accc896c196cb70037af89be6dc826c05
Gerrit-Change-Number: 24817
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210704/c7ac2ff8/attachment.htm>


More information about the gerrit-log mailing list