pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42062?usp=email )
Change subject: lm: Initialize layer manager also on role=SG
......................................................................
lm: Initialize layer manager also on role=SG
Right now the LM will stay in IDLE for role=SG, but it already provides
with an easier logic where all xUA ASPs (no matter their role) have an
associated FSM object, which can be extnded later on.
This way we already valdiate the FSM instance lifecycle wroks as
expected.
It also allows in the future more easily integrating the LM in role
IPSP, where it will need to be extended.
Change-Id: I1f25cf8371ba72d710796e01a9a967d3fafffb99
---
M src/ss7_asp.c
M src/xua_default_lm_fsm.c
2 files changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran
refs/changes/62/42062/1
diff --git a/src/ss7_asp.c b/src/ss7_asp.c
index e69ffd1..6d73a32 100644
--- a/src/ss7_asp.c
+++ b/src/ss7_asp.c
@@ -919,8 +919,7 @@
}
/* Apply default LM FSM for client ASP */
- if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA &&
- asp->cfg.role == OSMO_SS7_ASP_ROLE_ASP)
+ if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA)
asp->lm = xua_layer_manager_default_alloc(asp);
if ((rc = xua_asp_fsm_start(asp, LOGL_DEBUG)) < 0)
diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c
index bfd00e9..5d275c0 100644
--- a/src/xua_default_lm_fsm.c
+++ b/src/xua_default_lm_fsm.c
@@ -167,9 +167,11 @@
switch (event) {
case LM_E_SCTP_EST_IND:
- /* Try to transition to ASP-UP, wait to receive message for a
few seconds */
- lm_fsm_state_chg(fi, S_WAIT_ASP_UP);
- osmo_fsm_inst_dispatch(lmp->asp->fi, XUA_ASP_E_M_ASP_UP_REQ,
NULL);
+ if (lmp->asp->cfg.role == OSMO_SS7_ASP_ROLE_ASP) {
+ /* Try to transition to ASP-UP, wait to receive message
for a few seconds */
+ lm_fsm_state_chg(fi, S_WAIT_ASP_UP);
+ osmo_fsm_inst_dispatch(lmp->asp->fi,
XUA_ASP_E_M_ASP_UP_REQ, NULL);
+ }
break;
}
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42062?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I1f25cf8371ba72d710796e01a9a967d3fafffb99
Gerrit-Change-Number: 42062
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>