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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gprs_ns2: use llist_add_tail to keep order<br><br>When configuring multiple NSE/BINDs the order of the configuration<br>should be keeped.<br><br>Related: OS#5181<br>Change-Id: Ibbc03f0780b49543b5bd97ee059f11cfd6c2a126<br>---<br>M src/gb/gprs_ns2.c<br>M src/gb/gprs_ns2_vty.c<br>M tests/gb/gprs_ns2_vty.vty<br>3 files changed, 10 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c</span><br><span>index 618d55e..3bf31a3 100644</span><br><span>--- a/src/gb/gprs_ns2.c</span><br><span>+++ b/src/gb/gprs_ns2.c</span><br><span>@@ -609,8 +609,8 @@</span><br><span>    rate_ctr_group_set_name(nsvc->ctrg, id);</span><br><span>  osmo_stat_item_group_set_name(nsvc->statg, id);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  llist_add(&nsvc->list, &nse->nsvc);</span><br><span style="color: hsl(0, 100%, 40%);">-       llist_add(&nsvc->blist, &bind->nsvc);</span><br><span style="color: hsl(120, 100%, 40%);">+   llist_add_tail(&nsvc->list, &nse->nsvc);</span><br><span style="color: hsl(120, 100%, 40%);">+        llist_add_tail(&nsvc->blist, &bind->nsvc);</span><br><span>     ns2_nse_update_mtu(nse);</span><br><span> </span><br><span>         return nsvc;</span><br><span>@@ -809,7 +809,7 @@</span><br><span>   nse->nsi = nsi;</span><br><span>   nse->first = true;</span><br><span>        nse->mtu = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-        llist_add(&nse->list, &nsi->nse);</span><br><span style="color: hsl(120, 100%, 40%);">+       llist_add_tail(&nse->list, &nsi->nse);</span><br><span>         INIT_LLIST_HEAD(&nse->nsvc);</span><br><span> </span><br><span>      return nse;</span><br><span>@@ -1633,7 +1633,7 @@</span><br><span>  bind->sns_data_weight = 1;</span><br><span>        bind->nsi = nsi;</span><br><span>  INIT_LLIST_HEAD(&bind->nsvc);</span><br><span style="color: hsl(0, 100%, 40%);">-    llist_add(&bind->list, &nsi->binding);</span><br><span style="color: hsl(120, 100%, 40%);">+  llist_add_tail(&bind->list, &nsi->binding);</span><br><span> </span><br><span>        nsi->bind_rate_ctr_idx++;</span><br><span> </span><br><span>diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c</span><br><span>index 2777641..705b60e 100644</span><br><span>--- a/src/gb/gprs_ns2_vty.c</span><br><span>+++ b/src/gb/gprs_ns2_vty.c</span><br><span>@@ -141,7 +141,7 @@</span><br><span> </span><br><span>  vbind->ip_sns_sig_weight = 1;</span><br><span>     vbind->ip_sns_data_weight = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-       llist_add(&vbind->list, &binds);</span><br><span style="color: hsl(120, 100%, 40%);">+   llist_add_tail(&vbind->list, &binds);</span><br><span>     return vbind;</span><br><span> }</span><br><span> </span><br><span>@@ -172,7 +172,7 @@</span><br><span> </span><br><span>     vnse->nsei = nsei;</span><br><span>        INIT_LLIST_HEAD(&vnse->binds);</span><br><span style="color: hsl(0, 100%, 40%);">-   llist_add(&vnse->list, &nses);</span><br><span style="color: hsl(120, 100%, 40%);">+     llist_add_tail(&vnse->list, &nses);</span><br><span>       return vnse;</span><br><span> }</span><br><span> </span><br><span>diff --git a/tests/gb/gprs_ns2_vty.vty b/tests/gb/gprs_ns2_vty.vty</span><br><span>index 891bde5..4589f96 100644</span><br><span>--- a/tests/gb/gprs_ns2_vty.vty</span><br><span>+++ b/tests/gb/gprs_ns2_vty.vty</span><br><span>@@ -54,15 +54,15 @@</span><br><span> OsmoNSdummy# show ns</span><br><span> NSEI 01234: UDP, DEAD</span><br><span>   3 NS-VC:</span><br><span style="color: hsl(0, 100%, 40%);">-   NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496</span><br><span style="color: hsl(0, 100%, 40%);">-   NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496</span><br><span>    NSVCI none: RECOVERING PERSIST data_weight=1 sig_weight=1 udp)[127.0.0.14]:42999<>[127.0.0.15]:9496</span><br><span style="color: hsl(120, 100%, 40%);">+   NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496</span><br><span style="color: hsl(120, 100%, 40%);">+   NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496</span><br><span> UDP bind: 127.0.0.14:42999 DSCP: 0 Priority: 0</span><br><span>   IP-SNS signalling weight: 1 data weight: 1</span><br><span>   3 NS-VC:</span><br><span style="color: hsl(0, 100%, 40%);">-   NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496</span><br><span style="color: hsl(0, 100%, 40%);">-   NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496</span><br><span>    NSVCI none: RECOVERING PERSIST data_weight=1 sig_weight=1 udp)[127.0.0.14]:42999<>[127.0.0.15]:9496</span><br><span style="color: hsl(120, 100%, 40%);">+   NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496</span><br><span style="color: hsl(120, 100%, 40%);">+   NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496</span><br><span> OsmoNSdummy# configure terminal</span><br><span> OsmoNSdummy(config)# ns</span><br><span> OsmoNSdummy(config-ns)# nse 1234</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/24682">change 24682</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/+/24682"/><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: Ibbc03f0780b49543b5bd97ee059f11cfd6c2a126 </div>
<div style="display:none"> Gerrit-Change-Number: 24682 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Assignee: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>