Change in osmo-msc[master]: vlr_sgs: Balance use_count incremented in vlr_sgs_loc_update

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/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Aug 24 12:59:35 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/25236 )


Change subject: vlr_sgs: Balance use_count incremented in vlr_sgs_loc_update
......................................................................

vlr_sgs: Balance use_count incremented in vlr_sgs_loc_update

During a recent pcap trace, it was spotted that subscriber coming from
SGs had a use count with 16 "SGs" items, and later it incremented to 17.
Further investigation shows that the related use_count item was never
decreased, meaning every time an SGs-LU was sent by the MME, the item
was incremented further and never decremented.

Let's rename the item to be referenced while in LU, and then decremented
when LU is done. At that time, either the LU was accepted and the
subscriber object has a use_count item "attached", or it was rejected
and we already sent the reject messages, so we are fine deleting it if
needed.

Related: SYS#5337
Change-Id: I22c386f02ffa57428f700b003cc2cf23133598d0
---
M include/osmocom/msc/vlr_sgs.h
M src/libvlr/vlr_sgs.c
2 files changed, 7 insertions(+), 2 deletions(-)



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

diff --git a/include/osmocom/msc/vlr_sgs.h b/include/osmocom/msc/vlr_sgs.h
index 05e062b..7231449 100644
--- a/include/osmocom/msc/vlr_sgs.h
+++ b/include/osmocom/msc/vlr_sgs.h
@@ -26,7 +26,7 @@
 struct vlr_subscr;
 struct vlr_instance;
 
-#define VSUB_USE_SGS "SGs"
+#define VSUB_USE_SGS_LU "SGs-lu"
 #define VSUB_USE_SGS_PAGING_REQ "SGs-paging-req"
 
 /* See also 3GPP TS 29.118, chapter 4.2.2 States at the VLR */
diff --git a/src/libvlr/vlr_sgs.c b/src/libvlr/vlr_sgs.c
index 6421581..61db585 100644
--- a/src/libvlr/vlr_sgs.c
+++ b/src/libvlr/vlr_sgs.c
@@ -83,7 +83,7 @@
 	OSMO_ASSERT(cfg);
 	OSMO_ASSERT(imsi);
 
-	vsub = vlr_subscr_find_or_create_by_imsi(vlr, imsi, VSUB_USE_SGS, NULL);
+	vsub = vlr_subscr_find_or_create_by_imsi(vlr, imsi, VSUB_USE_SGS_LU, NULL);
 	if (!vsub) {
 		LOGP(DSGS, LOGL_ERROR, "VLR subscriber allocation failed\n");
 		return -EINVAL;
@@ -119,6 +119,9 @@
 {
 	osmo_fsm_inst_dispatch(vsub->sgs_fsm, SGS_UE_E_TX_LU_ACCEPT, NULL);
 
+	/* Balance vlr_subscr_find_or_create_by_imsi() in vlr_sgs_loc_update() */
+	vlr_subscr_put(vsub, VSUB_USE_SGS_LU);
+
 	/* FIXME: At this point we need to check the status of Ts5 and if
 	 * it is still running this means the LU has interrupted the paging,
 	 * and we need to start paging again. 3GPP TS 29.118,
@@ -130,6 +133,8 @@
 void vlr_sgs_loc_update_rej_sent(struct vlr_subscr *vsub)
 {
 	osmo_fsm_inst_dispatch(vsub->sgs_fsm, SGS_UE_E_TX_LU_REJECT, NULL);
+	/* Balance vlr_subscr_find_or_create_by_imsi() in vlr_sgs_loc_update() */
+	vlr_subscr_put(vsub, VSUB_USE_SGS_LU);
 }
 
 /*! Perform an SGs IMSI detach.

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I22c386f02ffa57428f700b003cc2cf23133598d0
Gerrit-Change-Number: 25236
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210824/9264d667/attachment.htm>


More information about the gerrit-log mailing list