xua: Reset AS traffic mode set by peer during shutdown

This way the AS can be configured to use different traffic modes over
time as long as they don't overlap in time. That is in this case where
no specific traffic mode is specified in AS local configuration (VTY).

Some RFC4666 state similar behvor of deleting data set by ASPs during AS
shutdown. For instance:
"""
   Other ASPs may continue to be associated with the Application Server,
   in which case the Routing Key data SHOULD NOT be deleted.  If a
   Deregistration results in no more ASPs in an Application Server, an
   SG MAY delete the Routing Key data.
"""

This allows for tests to easily re-use same AS to test different traffic
modes as long as they wait for the recovery timeout (2 secs by default,
configurable via VTY).
Related: OS#4220
Change-Id: I370aa3b5ddfc456c1be5b2585f2f470d5aa8d289
This commit is contained in:
Pau Espin 2019-11-06 15:40:28 +01:00 committed by laforge
parent bd8dff2751
commit c71fb71916
1 changed files with 12 additions and 0 deletions

View File

@ -252,6 +252,17 @@ static void xua_as_fsm_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
case XUA_AS_S_PENDING:
npar.status_info = M3UA_NOTIFY_I_AS_PEND;
break;
case XUA_AS_S_DOWN:
/* RFC4666 sec 4.3.2 AS States:
If we end up here, it means no ASP is ACTIVE or INACTIVE,
meaning no ASP can have already configured the traffic mode
in ASPAC or REG REQ. Hence, we can clear traffic mode defined
by peers and allow next first peer to request a new traffic
mode. */
as->cfg.mode_set_by_peer = false;
if (!as->cfg.mode_set_by_vty)
as->cfg.mode = OSMO_SS7_AS_TMOD_OVERRIDE;
return;
default:
return;
}
@ -374,6 +385,7 @@ static const struct osmo_fsm_state xua_as_fsm_states[] = {
S(XUA_AS_S_INACTIVE),
.name = "AS_DOWN",
.action = xua_as_fsm_down,
.onenter = xua_as_fsm_onenter,
},
[XUA_AS_S_INACTIVE] = {
.in_event_mask = S(XUA_ASPAS_ASP_DOWN_IND) |