<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/20843">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">process_ms_ctx_status: refactor to avoid code duplication<br><br>Change-Id: I1d1a1284c1563b3a5598e79d8ffd544288de4d62<br>---<br>M src/sgsn/gprs_gmm.c<br>1 file changed, 10 insertions(+), 15 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/43/20843/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c</span><br><span>index bf72cd6..0ad6003 100644</span><br><span>--- a/src/sgsn/gprs_gmm.c</span><br><span>+++ b/src/sgsn/gprs_gmm.c</span><br><span>@@ -1524,21 +1524,16 @@</span><br><span>       * being in state PDP-INACTIVE. */</span><br><span> </span><br><span>       llist_for_each_entry_safe(pdp, pdp2, &mmctx->pdp_list, list) {</span><br><span style="color: hsl(0, 100%, 40%);">-           if (pdp->nsapi < 8) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     if (!(pdp_status[0] & (1 << pdp->nsapi))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                LOGMMCTXP(LOGL_NOTICE, mmctx, "Dropping PDP context for NSAPI=%u "</span><br><span style="color: hsl(0, 100%, 40%);">-                                    "due to PDP CTX STATUS IE= 0x%02x%02x\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                                     pdp->nsapi, pdp_status[1], pdp_status[0]);</span><br><span style="color: hsl(0, 100%, 40%);">-                           sgsn_delete_pdp_ctx(pdp);</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (!(pdp_status[1] & (1 << (pdp->nsapi - 8)))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                          LOGMMCTXP(LOGL_NOTICE, mmctx, "Dropping PDP context for NSAPI=%u "</span><br><span style="color: hsl(0, 100%, 40%);">-                                    "due to PDP CTX STATUS IE= 0x%02x%02x\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                                     pdp->nsapi, pdp_status[1], pdp_status[0]);</span><br><span style="color: hsl(0, 100%, 40%);">-                           sgsn_delete_pdp_ctx(pdp);</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(120, 100%, 40%);">+             bool inactive = (pdp->nsapi < 8) ?</span><br><span style="color: hsl(120, 100%, 40%);">+                                      !(pdp_status[0] & (1 << pdp->nsapi)) :</span><br><span style="color: hsl(120, 100%, 40%);">+                                   !(pdp_status[1] & (1 << (pdp->nsapi - 8)));</span><br><span style="color: hsl(120, 100%, 40%);">+              if (!inactive)</span><br><span style="color: hsl(120, 100%, 40%);">+                        continue;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           LOGMMCTXP(LOGL_NOTICE, mmctx, "Dropping PDP context for NSAPI=%u "</span><br><span style="color: hsl(120, 100%, 40%);">+                  "due to PDP CTX STATUS IE=0x%02x%02x\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                    pdp->nsapi, pdp_status[1], pdp_status[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+         sgsn_delete_pdp_ctx(pdp);</span><br><span>    }</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/20843">change 20843</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/+/20843"/><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: I1d1a1284c1563b3a5598e79d8ffd544288de4d62 </div>
<div style="display:none"> Gerrit-Change-Number: 20843 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>