neels has posted comments on this change. ( )

Change subject: gprs_gmm.c: Call mmctx_set_(p)mm_state only on related ran_type

Patch Set 2:


I'm advocating for OSMO_ASSERTS(); they would probably give us more SGSN 
crashes, but then we stand a chance of finding bugs related to a subscriber 
switching RAN types. The aim could also be to not crash and instead log errors 
and detach the subscriber, not so sure.
File src/gprs/gprs_gmm.c:
PS2, Line 140: {
Vadim's idea seems very good, and I would add:
Place an OSMO_ASSERT for matching RAN type to catch all bugs that mix and mess 
it up.
(Am not aware of the callers but would assume no mismatching RAN type state 
should ever be passed to this.)
PS2, Line 153:  case PMM_CONNECTED:
(while at it we could lose this 'case', or even make the entire switch into an 
PS2, Line 204:                  mmctx_set_pmm_state(mm, PMM_IDLE);
how could a RANAP_IU_EVENT come in on a ran_type != MM_CTX_T_UTRAN_Iu? I guess 
that should be an OSMO_ASSERT()?
PS2, Line 1096:         case GSM48_MT_GMM_SERVICE_REQ:
again this looks like it is clearly related to Iu and ran_type should always be 
PS2, Line 2084:                 mmctx->gmm_state = GMM_REGISTERED_NORMAL;
I know this was in the code before, but it seems to overwrite the previous 
state. Both RAN types set the state after this, so this is redundant and may 
confuse logging?
(It says "Changing state from X to Y", where the X is here always 
GMM_REGISTERED_NORMAL, although the state would have been something else before 
PS2, Line 2097:                 case MM_CTX_T_GERAN_Iu:
(instead of all of these dead switch cases, maybe we should rather "#if 0" away 
the unused enum member)
PS2, Line 2116:                 mmctx->gmm_state = GMM_REGISTERED_NORMAL;
(again weird overwriting of the current state, like above)

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I65ad9e180177bc9fc7c4a037cd85cfe33b161f73
Gerrit-Change-Number: 15186
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <>
Gerrit-CC: neels <>
Gerrit-Comment-Date: Wed, 14 Aug 2019 23:39:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reply via email to