<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/20842">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sgsn_delete_pdp_ctx: Add documentation and assert assumptions<br><br>This function is only expected to be called if the GTP side of the PDP<br>ctx is still alive, since it will tear down the GTP side and then finish<br>the pending MS side if needed.<br><br>The asserts are added to ease debugging since it was noted that a few<br>callers were using this function without properly checking the status of<br>the pdp ctx.<br><br>Related: OS#4817<br>Change-Id: I4248e2e9846fec5ae2c8557384da2deb86668c50<br>---<br>M src/sgsn/sgsn_libgtp.c<br>1 file changed, 6 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/42/20842/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 8081492..367570d 100644</span><br><span>--- a/src/sgsn/sgsn_libgtp.c</span><br><span>+++ b/src/sgsn/sgsn_libgtp.c</span><br><span>@@ -312,11 +312,16 @@</span><br><span>         return pctx;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/* SGSN wants to delete a PDP context */</span><br><span style="color: hsl(120, 100%, 40%);">+/* SGSN wants to delete a PDP context, send first DeleteCtxReq on the GTP side,</span><br><span style="color: hsl(120, 100%, 40%);">+   then upon DeleteCtx ACK it will send DeactPdpAcc to the MS if still</span><br><span style="color: hsl(120, 100%, 40%);">+   connected. */</span><br><span> int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx)</span><br><span> {</span><br><span>  LOGPDPCTXP(LOGL_INFO, pctx, "Delete PDP Context\n");</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    OSMO_ASSERT(pctx->ggsn);</span><br><span style="color: hsl(120, 100%, 40%);">+   OSMO_ASSERT(pctx->lib);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         /* FIXME: decide if we need teardown or not ! */</span><br><span>     return gtp_delete_context_req2(pctx->ggsn->gsn, pctx->lib, pctx, 1);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/20842">change 20842</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/+/20842"/><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: I4248e2e9846fec5ae2c8557384da2deb86668c50 </div>
<div style="display:none"> Gerrit-Change-Number: 20842 </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>