<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12049">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">SS/USSD: fix: properly (re)schedule NCSS session timeout<br><br>It may happen that either the MS or an ESME would become<br>unresponsive, e.g. due to a bug, or a dropped message. This<br>is why we have SS session timeout, that prevents keeping<br>'stalled' sessions forever.<br><br>For some reason, it wasn't properly resceduled in case of<br>subsequent SS/USSD activity, so the lifetime of a session<br>was limited. Let's properly (re)schedule it.<br><br>Change-Id: I11aeacf012b06d3d0b5cc6e64baecf857b645fda<br>Related: OS#3717<br>---<br>M src/hlr_ussd.c<br>1 file changed, 7 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c</span><br><span>index 16a197c..cc6aa8a 100644</span><br><span>--- a/src/hlr_ussd.c</span><br><span>+++ b/src/hlr_ussd.c</span><br><span>@@ -208,10 +208,9 @@</span><br><span> </span><br><span>    OSMO_STRLCPY_ARRAY(ss->imsi, imsi);</span><br><span>       ss->session_id = session_id;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Schedule self-destruction timer */</span><br><span>        osmo_timer_setup(&ss->timeout, ss_session_timeout, ss);</span><br><span style="color: hsl(0, 100%, 40%);">-  /* NOTE: The timeout is currently not refreshed with subsequent messages</span><br><span style="color: hsl(0, 100%, 40%);">-         * within the SS/USSD session. So X seconds after the initial SS message,</span><br><span style="color: hsl(0, 100%, 40%);">-        * the session will timeout! */</span><br><span>      if (g_hlr->ncss_guard_timeout > 0)</span><br><span>             osmo_timer_schedule(&ss->timeout, g_hlr->ncss_guard_timeout, 0);</span><br><span> </span><br><span>@@ -538,6 +537,11 @@</span><br><span>                                gsup->imsi, gsup->session_id);</span><br><span>                         goto out_err;</span><br><span>                }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           /* Reschedule self-destruction timer */</span><br><span style="color: hsl(120, 100%, 40%);">+               if (g_hlr->ncss_guard_timeout > 0)</span><br><span style="color: hsl(120, 100%, 40%);">+                      osmo_timer_schedule(&ss->timeout, g_hlr->ncss_guard_timeout, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                 if (ss_op_is_ussd(req.opcode)) {</span><br><span>                     /* dispatch unstructured SS to routing */</span><br><span>                    handle_ussd(conn, ss, gsup, &req);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12049">change 12049</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/12049"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I11aeacf012b06d3d0b5cc6e64baecf857b645fda </div>
<div style="display:none"> Gerrit-Change-Number: 12049 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>