pespin has submitted this change. ( 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, 7 insertions(+), 5 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved
diff --git a/src/ss7_asp.c b/src/ss7_asp.c index 68c783e..5e96519 100644 --- a/src/ss7_asp.c +++ b/src/ss7_asp.c @@ -702,8 +702,8 @@ static void ss7_asp_xua_layer_manager_start(struct osmo_ss7_asp *asp) { OSMO_ASSERT(!asp->lm); - if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA || - asp->cfg.role != OSMO_SS7_ASP_ROLE_ASP) + /* No LM in IPA */ + if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA) return;
asp->lm = xua_layer_manager_default_alloc(asp); diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 2346ffb..3e364c1 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; } }