gprs_ns2: use llist_add_tail to keep order
When configuring multiple NSE/BINDs the order of the configuration
should be keeped.
Related: OS#5181
Change-Id: Ibbc03f0780b49543b5bd97ee059f11cfd6c2a126
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 618d55e..3bf31a3 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -609,8 +609,8 @@
rate_ctr_group_set_name(nsvc->ctrg, id);
osmo_stat_item_group_set_name(nsvc->statg, id);
- llist_add(&nsvc->list, &nse->nsvc);
- llist_add(&nsvc->blist, &bind->nsvc);
+ llist_add_tail(&nsvc->list, &nse->nsvc);
+ llist_add_tail(&nsvc->blist, &bind->nsvc);
ns2_nse_update_mtu(nse);
return nsvc;
@@ -809,7 +809,7 @@
nse->nsi = nsi;
nse->first = true;
nse->mtu = 0;
- llist_add(&nse->list, &nsi->nse);
+ llist_add_tail(&nse->list, &nsi->nse);
INIT_LLIST_HEAD(&nse->nsvc);
return nse;
@@ -1633,7 +1633,7 @@
bind->sns_data_weight = 1;
bind->nsi = nsi;
INIT_LLIST_HEAD(&bind->nsvc);
- llist_add(&bind->list, &nsi->binding);
+ llist_add_tail(&bind->list, &nsi->binding);
nsi->bind_rate_ctr_idx++;
diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index 2777641..705b60e 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -141,7 +141,7 @@
vbind->ip_sns_sig_weight = 1;
vbind->ip_sns_data_weight = 1;
- llist_add(&vbind->list, &binds);
+ llist_add_tail(&vbind->list, &binds);
return vbind;
}
@@ -172,7 +172,7 @@
vnse->nsei = nsei;
INIT_LLIST_HEAD(&vnse->binds);
- llist_add(&vnse->list, &nses);
+ llist_add_tail(&vnse->list, &nses);
return vnse;
}
diff --git a/tests/gb/gprs_ns2_vty.vty b/tests/gb/gprs_ns2_vty.vty
index 891bde5..4589f96 100644
--- a/tests/gb/gprs_ns2_vty.vty
+++ b/tests/gb/gprs_ns2_vty.vty
@@ -54,15 +54,15 @@
OsmoNSdummy# show ns
NSEI 01234: UDP, DEAD
3 NS-VC:
- NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496
- NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496
NSVCI none: RECOVERING PERSIST data_weight=1 sig_weight=1 udp)[127.0.0.14]:42999<>[127.0.0.15]:9496
+ NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496
+ NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496
UDP bind: 127.0.0.14:42999 DSCP: 0 Priority: 0
IP-SNS signalling weight: 1 data weight: 1
3 NS-VC:
- NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496
- NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496
NSVCI none: RECOVERING PERSIST data_weight=1 sig_weight=1 udp)[127.0.0.14]:42999<>[127.0.0.15]:9496
+ NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496
+ NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496
OsmoNSdummy# configure terminal
OsmoNSdummy(config)# ns
OsmoNSdummy(config-ns)# nse 1234