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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gprs_ns2_vc_fsm: check NSVCI match the NSE<br><br>The NSVCI must match the PDUs. The only exception is a RESET with<br>dialect ipaccess. However those will be handled later.<br><br>Change-Id: I0ebdd4f4135b03a7d44a93aff3846c8ec19f333b<br>---<br>M src/gb/gprs_ns2_vc_fsm.c<br>1 file changed, 14 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c</span><br><span>index 3ec6909..d4f4320 100644</span><br><span>--- a/src/gb/gprs_ns2_vc_fsm.c</span><br><span>+++ b/src/gb/gprs_ns2_vc_fsm.c</span><br><span>@@ -750,11 +750,10 @@</span><br><span>     struct osmo_fsm_inst *fi = nsvc->fi;</span><br><span>      int rc = 0;</span><br><span>  uint8_t cause;</span><br><span style="color: hsl(0, 100%, 40%);">-  uint16_t nsei;</span><br><span style="color: hsl(120, 100%, 40%);">+        uint16_t nsei, nsvci;</span><br><span> </span><br><span>    /* TODO: 7.2: on UNBLOCK/BLOCK: check if NS-VCI is correct,</span><br><span>   *  if not answer STATUS with "NS-VC unknown" */</span><br><span style="color: hsl(0, 100%, 40%);">-      /* TODO: handle RESET with different VCI */</span><br><span>  /* TODO: handle BLOCK/UNBLOCK/ALIVE with different VCI */</span><br><span> </span><br><span>        if (gprs_ns2_validate(nsvc, nsh->pdu_type, msg, tp, &cause)) {</span><br><span>@@ -777,6 +776,19 @@</span><br><span>                 }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (nsvc->nsvci_is_valid && TLVP_PRESENT(tp,  NS_IE_VCI)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                nsvci = tlvp_val16be(tp, NS_IE_VCI);</span><br><span style="color: hsl(120, 100%, 40%);">+          if (nsvci != nsvc->nsvci) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        /* 48.016 ยง 7.3.1 send RESET_ACK to wrong NSVCI + ignore */</span><br><span style="color: hsl(120, 100%, 40%);">+                  if (nsh->pdu_type == NS_PDUT_RESET)</span><br><span style="color: hsl(120, 100%, 40%);">+                                ns2_tx_reset_ack(nsvc);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                     LOGNSVC(nsvc, LOGL_ERROR, "Rx %s with wrong NSVCI=%05u. Ignoring PDU.\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                           get_value_string(gprs_ns_pdu_strings, nsh->pdu_type), nsvci);</span><br><span style="color: hsl(120, 100%, 40%);">+                      goto out;</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  switch (nsh->pdu_type) {</span><br><span>  case NS_PDUT_RESET:</span><br><span>          osmo_fsm_inst_dispatch(fi, GPRS_NS2_EV_RX_RESET, tp);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/22425">change 22425</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/+/22425"/><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: I0ebdd4f4135b03a7d44a93aff3846c8ec19f333b </div>
<div style="display:none"> Gerrit-Change-Number: 22425 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>