<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/22708">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gb: frame_relay: Detect link outage on "last receive seq nr == 0"<br><br>this is a bit of a hack.  Q.933 explicitly forbids either side from ever<br>sending a sequence number of '0'.  Values start from '1' and are modulo 256,<br>but '0' is always skipped.  So if the peer is sending us a "last received<br>sequence number of '0' it means it has not yet received any packets from us,<br>which in turn can only mean that it has just been restarted.  Let's treat<br>this as "service affecting condition" and notify upper layers.  This helps<br>particularly in recovering from rapidly re-starting peers, where the Q.933<br>nor NS have time to actually detect the connection was lost.<br><br>Change-Id: I960a7b17f2550cb49a7b9d72ed87cd271bb64122<br>Related: OS#4974<br>---<br>M src/gb/frame_relay.c<br>1 file changed, 11 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gb/frame_relay.c b/src/gb/frame_relay.c</span><br><span>index 679a315..7c75cd0 100644</span><br><span>--- a/src/gb/frame_relay.c</span><br><span>+++ b/src/gb/frame_relay.c</span><br><span>@@ -382,9 +382,19 @@</span><br><span>      link_int_rx = TLVP_VAL(tp, Q933_IEI_LINK_INT_VERIF);</span><br><span>         link->last_rx_seq = link_int_rx[0];</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    /* this is a bit of a hack.  Q.933 explicitly forbids either side from ever</span><br><span style="color: hsl(120, 100%, 40%);">+    * sending a sequence number of '0'.  Values start from '1' and are modulo 256,</span><br><span style="color: hsl(120, 100%, 40%);">+        * but '0' is always skipped.  So if the peer is sending us a "last received</span><br><span style="color: hsl(120, 100%, 40%);">+      * sequence number of '0' it means it has not yet received any packets from us,</span><br><span style="color: hsl(120, 100%, 40%);">+        * which in turn can only mean that it has just been restarted.  Let's treat</span><br><span style="color: hsl(120, 100%, 40%);">+       * this as "service affecting condition" and notify upper layers.  This helps</span><br><span style="color: hsl(120, 100%, 40%);">+        * particularly in recovering from rapidly re-starting peers, where the Q.933</span><br><span style="color: hsl(120, 100%, 40%);">+  * nor NS have time to actually detect the connection was lost.  Se OS#4974 */</span><br><span style="color: hsl(120, 100%, 40%);">+        if (link_int_rx[1] == 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+            link_set_failed(link);</span><br><span>       /* the network checks the receive sequence number received from</span><br><span>       * the user equipment against its send sequence counter */</span><br><span style="color: hsl(0, 100%, 40%);">-      if (link_int_rx[1] != link->last_tx_seq) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (link_int_rx[1] != link->last_tx_seq) {</span><br><span>                 check_link_state(link, false);</span><br><span>               link->err_count++;</span><br><span>        } else {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/22708">change 22708</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/libosmocore/+/22708"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I960a7b17f2550cb49a7b9d72ed87cd271bb64122 </div>
<div style="display:none"> Gerrit-Change-Number: 22708 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>