<p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487">View Change</a></p><p>6 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/11/src/sgsn/gprs_gmm.c">File src/sgsn/gprs_gmm.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/11/src/sgsn/gprs_gmm.c@1232">Patch Set #11, Line 1232:</a> <code style="font-family:monospace,monospace">  if (MSG_IU_UE_CTX(msg) && ctx->ran_type != MM_CTX_T_UTRAN_Iu)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Would be nice adding a comment here like: /* Detect MS switched to new a Radio Access technology */</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/11/src/sgsn/gprs_gmm.c@1644">Patch Set #11, Line 1644:</a> <code style="font-family:monospace,monospace">  if (MSG_IU_UE_CTX(msg) && mmctx->ran_type != MM_CTX_T_UTRAN_Iu)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">The problem overall is, we have to refactor the full Attach Request/RAU logic. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Thanks for the clarification. Refactoring the logic belongs in a different patch(set), let's keep this for handling RAT changes and fixing the SGSN crash.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/11/src/sgsn/gprs_gmm.c@1649">Patch Set #11, Line 1649:</a> <code style="font-family:monospace,monospace">     osmo_fsm_inst_dispatch(mmctx->gmm_fsm, E_GMM_COMMON_PROC_INIT_REQ, NULL);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">So we need to find out before merging this patch blindly.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Seems Lynxis moved the call here from line 1607 so we don't accidentally send messages (and crash) before handling the RAT change. I re-added the call to the code above with a check whether the RAT has changed.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/11/src/sgsn/gprs_gmm.c@1663">Patch Set #11, Line 1663:</a> <code style="font-family:monospace,monospace">              if (!mmctx->gb.llme)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Agree, you probably want to pass new_rat_type, llme and msg.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Actually the IMPLICIT_DETACH event causes the gb fsm to to to idle which in turn unassigns the llme and sets it to NULL.</p><p style="white-space: pre-wrap; word-wrap: break-word;">However, implicit detach is only handled from the mm_ready state and not from mm_standby. I think we should implement add that to the the gb fsm so we don't need to do this here or in the gmm_fsm.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/9/src/sgsn/gprs_gmm_fsm.c">File src/sgsn/gprs_gmm_fsm.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/9/src/sgsn/gprs_gmm_fsm.c@173">Patch Set #9, Line 173:</a> <code style="font-family:monospace,monospace">(enum sgsn_ran_type) data;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I am pretty sure Coverity is not gonna like this this hack...</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">When we pass a struct * as user data this will be resolved.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/11/src/sgsn/gprs_gmm_fsm.c">File src/sgsn/gprs_gmm_fsm.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487/11/src/sgsn/gprs_gmm_fsm.c@165">Patch Set #11, Line 165:</a> <code style="font-family:monospace,monospace">                       gmm_fsm_state_chg(fi, ST_GMM_DEREGISTERED);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I'm wondering whether the mmctx ran type needs to be set here too, or some stuff needs to be dealloc […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">It looks to me like we should just have a fall-through to the default: case in addition to setting the state to deregistered.</p><p style="white-space: pre-wrap; word-wrap: break-word;">There is nothing allocated in this fsm anyway it looks like, so I don't think there's anything to free?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487">change 15487</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15487"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sgsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I3fc614da6ba137e871ee0fe86ca22b6a4a354dd2 </div>
<div style="display:none"> Gerrit-Change-Number: 15487 </div>
<div style="display:none"> Gerrit-PatchSet: 12 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-CC: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 30 Jan 2020 17:00:25 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Comment-In-Reply-To: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Comment-In-Reply-To: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>