pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/37876?usp=email )
Change subject: ss7_as: Avoid dispatch event to asp with uninitialized FSM ......................................................................
ss7_as: Avoid dispatch event to asp with uninitialized FSM
It is expected that before being started (osmo_ss7_asp_restart() -> xua_asp_fsm_start()), an asp doesn't have an asp->fi pointer set. This is already checked in several places in code and even used to print "unitialized" state in vty introspection.
If the asp was assigned to an as (eg through vty) before it was started, then it would print the error log: "Trying to dispatch event 17 to non-existent FSM instance!"
Hence, check the fi is available. If it is not, it's totally fine not dispatching that event because it means the asp is still not started, and it will catch up taking the ipa-name from the when it is started.
Related: OS#6356 Related: SYS#5914 Fixes: 57444690212b1576eaf0a7156448ba2d27c59050 Fixes: 65741dca056e3a16973ad156dd4c09760a6a945b Change-Id: I4d201a60ecd1a4d8a5aa87e1fdb236f755ec152b --- M src/osmo_ss7_as.c 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: pespin: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve
diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c index 9d78897..9683e94 100644 --- a/src/osmo_ss7_as.c +++ b/src/osmo_ss7_as.c @@ -115,7 +115,8 @@ for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { if (!as->cfg.asps[i]) { as->cfg.asps[i] = asp; - osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_AS_ASSIGNED, as); + if (asp->fi) + osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_AS_ASSIGNED, as); return 0; } }