<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/23851">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gtp: Delete ctx upon receive UpdateCtxResp with cause Non-existent<br><br>Change-Id: Ic5f682a79663acc65fd364dd7a3a7cc554534414<br>---<br>M src/sgsn/sgsn_libgtp.c<br>1 file changed, 29 insertions(+), 0 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/51/23851/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c</span><br><span>index 367570d..8be7927 100644</span><br><span>--- a/src/sgsn/sgsn_libgtp.c</span><br><span>+++ b/src/sgsn/sgsn_libgtp.c</span><br><span>@@ -479,6 +479,33 @@</span><br><span>  gtp_echo_req(ggc->gsn, ggc->gtp_version, ggc, &ggc->remote_addr);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Confirmation of a PDP Context Update */</span><br><span style="color: hsl(120, 100%, 40%);">+static int update_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+   struct sgsn_pdp_ctx *pctx = cbp;</span><br><span style="color: hsl(120, 100%, 40%);">+      int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     LOGPDPCTXP(LOGL_INFO, pctx, "Received Update PDP CTX CONF, cause=%d(%s)\n",</span><br><span style="color: hsl(120, 100%, 40%);">+         cause, get_value_string(gtp_cause_strs, cause));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    /* 3GPP TS 29.060 "7.3.4":</span><br><span style="color: hsl(120, 100%, 40%);">+   * "If the SGSN receives an Update PDP Context Response with a Cause</span><br><span style="color: hsl(120, 100%, 40%);">+      * value other than "Request accepted", it shall abort the update of the</span><br><span style="color: hsl(120, 100%, 40%);">+     * PDP context.""</span><br><span style="color: hsl(120, 100%, 40%);">+    * "If the SGSN receives an Update PDP Context Response with</span><br><span style="color: hsl(120, 100%, 40%);">+      * a Cause value "Non-existent", it shall delete the PDP Context."</span><br><span style="color: hsl(120, 100%, 40%);">+      */</span><br><span style="color: hsl(120, 100%, 40%);">+   if (cause != GTPCAUSE_NON_EXIST)</span><br><span style="color: hsl(120, 100%, 40%);">+               return 0; /* Nothing to do */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      LOGPDPCTXP(LOGL_INFO, pctx, "PDP CTX we tried to update doesn't exist in "</span><br><span style="color: hsl(120, 100%, 40%);">+                 "the GGSN anymore, deleting it locally.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   rc = gtp_freepdp(pctx->ggsn->gsn, pctx->lib);</span><br><span style="color: hsl(120, 100%, 40%);">+        /* related mmctx is torn down in cb_delete_context called by gtp_freepdp() */</span><br><span style="color: hsl(120, 100%, 40%);">+ return rc;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Confirmation of a PDP Context Delete */</span><br><span> static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)</span><br><span> {</span><br><span>@@ -577,6 +604,8 @@</span><br><span>              return echo_conf(cbp, cause == EOF);</span><br><span>         case GTP_CREATE_PDP_REQ:</span><br><span>             return create_pdp_conf(pdp, cbp, cause);</span><br><span style="color: hsl(120, 100%, 40%);">+      case GTP_UPDATE_PDP_REQ:</span><br><span style="color: hsl(120, 100%, 40%);">+              return update_pdp_conf(pdp, cbp, cause);</span><br><span>     case GTP_DELETE_PDP_REQ:</span><br><span>             return delete_pdp_conf(pdp, cbp, cause);</span><br><span>     default:</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/23851">change 23851</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/+/23851"/><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: Ic5f682a79663acc65fd364dd7a3a7cc554534414 </div>
<div style="display:none"> Gerrit-Change-Number: 23851 </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>