aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/msc_a.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-09-03 02:06:22 +0200
committerneels <nhofmeyr@sysmocom.de>2019-09-03 13:59:05 +0000
commit01653252b4b74e9b3637a384a3bdac4b35f94b88 (patch)
tree226079bf7a00cb088aeec8fd911f32f86cd8524b /src/libmsc/msc_a.c
parentf092301a0f240ef6497a31e2f3075ff283504ad0 (diff)
msc_a fsm: ignore state chg to same state
We sometimes see errors like libmsc/msc_a.c:361 msc_a(...){MSC_A_ST_RELEASING}: transition to state MSC_A_ST_RELEASING not permitted! i.e. changing state to the state msc_a is already in. Ignore re-entering the same state for most state changes. However, there is one state change in msc_a where re-entering the MSC_A_ST_VALIDATE_L3 is necessary to start the timeout. Hence add msc_a_state_chg_always() and use that for re-entering MSC_A_ST_VALIDATE_L3. Change msc_a_state_chg() to skip no-op state changes. This should silence all no-op state change error messages for msc_a. Related: OS#4169 Change-Id: I0c74c10b5fa7bbdd6ae3674926cc0393edf15a35
Diffstat (limited to 'src/libmsc/msc_a.c')
-rw-r--r--src/libmsc/msc_a.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index a082cb8f9..b41457458 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -63,9 +63,15 @@ static const struct osmo_tdef_state_timeout msc_a_fsm_timeouts[32] = {
/* Transition to a state, using the T timer defined in msc_a_fsm_timeouts.
* The actual timeout value is in turn obtained from network->T_defs.
* Assumes local variable fi exists. */
-#define msc_a_state_chg(msc_a, state) \
+#define msc_a_state_chg_always(msc_a, state) \
osmo_tdef_fsm_inst_state_chg((msc_a)->c.fi, state, msc_a_fsm_timeouts, (msc_a)->c.ran->tdefs, 5)
+/* Same as msc_a_state_chg_always() but ignore if the msc_a already is in the target state. */
+#define msc_a_state_chg(msc_a, STATE) do { \
+ if ((msc_a)->c.fi->state != STATE) \
+ msc_a_state_chg_always(msc_a, STATE); \
+ } while(0)
+
struct gsm_network *msc_a_net(const struct msc_a *msc_a)
{
return msub_net(msc_a->c.msub);
@@ -1036,7 +1042,7 @@ struct msc_a *msc_a_alloc(struct msub *msub, struct ran_infra *ran)
};
osmo_use_count_make_static_entries(&msc_a->use_count, msc_a->use_count_buf, ARRAY_SIZE(msc_a->use_count_buf));
/* Start timeout for first state */
- msc_a_state_chg(msc_a, MSC_A_ST_VALIDATE_L3);
+ msc_a_state_chg_always(msc_a, MSC_A_ST_VALIDATE_L3);
return msc_a;
}