Change in osmo-msc[master]: vlr_sgs: fix SGs IMSI detech from non EPS services

Harald Welte gerrit-no-reply at
Sun Apr 7 18:57:31 UTC 2019

Harald Welte has submitted this change and it was merged. ( )

Change subject: vlr_sgs: fix SGs IMSI detech from non EPS services

vlr_sgs: fix SGs IMSI detech from non EPS services

When the subscriber is detached from non EPS services while the
SGs-association is not SGs-NULL, it needs to be removed from the VLR

Change-Id: I575cf6036ad39468f590b2d57a06cd3512a4c31c
Related: OS#3614
M src/libvlr/vlr_sgs.c
1 file changed, 12 insertions(+), 0 deletions(-)

  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

diff --git a/src/libvlr/vlr_sgs.c b/src/libvlr/vlr_sgs.c
index 8614892..538c9f2 100644
--- a/src/libvlr/vlr_sgs.c
+++ b/src/libvlr/vlr_sgs.c
@@ -131,10 +131,17 @@
 	struct vlr_subscr *vsub;
 	enum sgs_ue_fsm_event evt;
 	vsub = vlr_subscr_find_by_imsi(vlr, imsi);
 	if (!vsub)
+	/* See also: 3GPP TS 29.118, 5.6.3 Procedures in the VLR: In case of
+	 * an implicit detach, we are supposed to check if the state of the
+	 * SGs-association, and only when it is not SGs-NULL, we may proceed. */
+	if (vsub->sgs_fsm->state == SGS_UE_ST_NULL && type == SGSAP_ID_NONEPS_T_IMPLICIT_UE_EPS_NONEPS)
+		return;
 	switch (type) {
@@ -153,6 +160,11 @@
 	osmo_fsm_inst_dispatch(vsub->sgs_fsm, evt, NULL);
+	/* Detaching from non EPS services essentially means that the
+	 * subscriber is detached from 2G. In any case the VLR will
+	 * get rid of the subscriber. */
+	vlr_subscr_expire(vsub);
 /*! Perform an SGs EPS detach.

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I575cf6036ad39468f590b2d57a06cd3512a4c31c
Gerrit-Change-Number: 13493
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list