<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/22424">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gprs_ns2_vc_fsm: check NSEI match the NSE<br><br>The NSE must match the PDUs. The only exception is a RESET with<br>dialect ipaccess. However those will be handled later.<br><br>Change-Id: I00bc04f3f46f5ae8ddd8b4b7d5479fb8e6463e1e<br>---<br>M src/gb/gprs_ns2_vc_fsm.c<br>1 file changed, 14 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/24/22424/1</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 fc2a86a..3ec6909 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,6 +750,7 @@</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(120, 100%, 40%);">+        uint16_t nsei;</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>@@ -763,6 +764,19 @@</span><br><span>            }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (TLVP_PRESENT(tp, NS_IE_NSEI)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           nsei = tlvp_val16be(tp, NS_IE_NSEI);</span><br><span style="color: hsl(120, 100%, 40%);">+          if (nsei != nsvc->nse->nsei) {</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 NSEI=%05u. Ignoring PDU.\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                            get_value_string(gprs_ns_pdu_strings, nsh->pdu_type), nsei);</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/+/22424">change 22424</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/+/22424"/><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: I00bc04f3f46f5ae8ddd8b4b7d5479fb8e6463e1e </div>
<div style="display:none"> Gerrit-Change-Number: 22424 </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-MessageType: newchange </div>