This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
lynxis lazus gerrit-no-reply at lists.osmocom.orglynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/21571 )
Change subject: gprs_ns2: move allocation of the SNS fsm into create_nse
......................................................................
gprs_ns2: move allocation of the SNS fsm into create_nse
The allocation of the SNS fsm can be done in create_nse
because the dialect is now known at that time.
Change-Id: I64e1f3dcc63d38e65bb486c9ac08d4032b7ad222
---
M src/gb/gprs_ns2.c
1 file changed, 13 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/71/21571/1
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 920fa68..57590a5 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -677,6 +677,7 @@
enum gprs_ns2_ll linklayer, enum gprs_ns2_dialect dialect)
{
struct gprs_ns2_nse *nse;
+ char sns[16];
nse = gprs_ns2_nse_by_nsei(nsi, nsei);
if (nse) {
@@ -688,6 +689,15 @@
if (!nse)
return NULL;
+ if (dialect == NS2_DIALECT_SNS) {
+ snprintf(sns, sizeof(sns), "nse-%d-sns", nsei);
+ nse->bss_sns_fi = ns2_sns_bss_fsm_alloc(nse, NULL);
+ if (!nse->bss_sns_fi) {
+ talloc_free(nse);
+ return NULL;
+ }
+ }
+
nse->dialect = dialect;
nse->ll = linklayer;
nse->nsei = nsei;
@@ -959,14 +969,11 @@
return -2;
}
- nsvc = gprs_ns2_ip_bind_connect(bind, nse, remote);
- if (!nsvc)
+ if (!nse->bss_sns_fi)
return -1;
- if (!nse->bss_sns_fi)
- nse->bss_sns_fi = ns2_sns_bss_fsm_alloc(nse, NULL);
-
- if (!nse->bss_sns_fi)
+ nsvc = gprs_ns2_ip_bind_connect(bind, nse, remote);
+ if (!nsvc)
return -1;
return ns2_sns_bss_fsm_start(nse, nsvc, remote);
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21571
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I64e1f3dcc63d38e65bb486c9ac08d4032b7ad222
Gerrit-Change-Number: 21571
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201207/10eee1a9/attachment.htm>