aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-04-25 15:01:33 +0200
committerHarald Welte <laforge@osmocom.org>2021-04-25 15:01:33 +0200
commitfe770ee0b171c5e79b2951558932ce13301f8eff (patch)
treec8cd155335299e34547c645a5267867dcbc5474a
parent9db62136200f99e0dd9e76e79ab6ec714af9fe96 (diff)
ipa_asp_fsm_del_route(): Log what happens if we bail out early
Let's inform the user about situations in which we'd want to delete the route for an IPA client, but we run into some problem and bail out early. Change-Id: Ie3f57d22901f169afb2c844476b5839cc36752aa Related: SYS#5422
-rw-r--r--src/xua_asp_fsm.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index c8dcac6..4630f5b 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -1010,8 +1010,9 @@ static void ipa_asp_fsm_wait_id_ack(struct osmo_fsm_inst *fi, uint32_t event, vo
}
}
-static void ipa_asp_fsm_del_route(struct ipa_asp_fsm_priv *iafp)
+static void ipa_asp_fsm_del_route(struct osmo_fsm_inst *fi)
{
+ struct ipa_asp_fsm_priv *iafp = fi->priv;
struct osmo_ss7_asp *asp = iafp->asp;
struct osmo_ss7_instance *inst = asp->inst;
/* We use routing-context '0' here, as that's the only one we support in IPA */
@@ -1023,11 +1024,20 @@ static void ipa_asp_fsm_del_route(struct ipa_asp_fsm_priv *iafp)
/* find the route which we have created if we ever reached ipa_asp_fsm_wait_id_ack2 */
rt = osmo_ss7_route_find_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff);
/* no route found, bail out */
- if (!rt)
+ if (!rt) {
+ LOGPFSML(fi, LOGL_NOTICE, "Attempting to delete route for this IPA ASP, but cannot "
+ "find route for DPC %s. Did you manually delete it?\n",
+ osmo_ss7_pointcode_print(inst, as->cfg.routing_key.pc));
return;
+ }
+
/* route points to different AS, bail out */
- if (rt->dest.as != as)
+ if (rt->dest.as != as) {
+ LOGPFSML(fi, LOGL_NOTICE, "Attempting to delete route for this IPA ASP, but found "
+ "route for DPC %s points to different AS (%s)\n",
+ osmo_ss7_pointcode_print(inst, as->cfg.routing_key.pc), rt->dest.as->cfg.name);
return;
+ }
osmo_ss7_route_destroy(rt);
/* FIXME: Why don't we also delete this timer if we return early above?
@@ -1041,7 +1051,7 @@ static void ipa_asp_fsm_active(struct osmo_fsm_inst *fi, uint32_t event, void *d
switch (event) {
case XUA_ASP_E_M_ASP_DOWN_REQ:
case XUA_ASP_E_M_ASP_INACTIVE_REQ:
- ipa_asp_fsm_del_route(fi->priv);
+ ipa_asp_fsm_del_route(fi);
osmo_fsm_inst_state_chg(fi, IPA_ASP_S_DOWN, 0, 0);
break;
}
@@ -1051,7 +1061,7 @@ static void ipa_asp_fsm_inactive(struct osmo_fsm_inst *fi, uint32_t event, void
{
switch (event) {
case XUA_ASP_E_M_ASP_DOWN_REQ:
- ipa_asp_fsm_del_route(fi->priv);
+ ipa_asp_fsm_del_route(fi);
osmo_fsm_inst_state_chg(fi, IPA_ASP_S_DOWN, 0, 0);
break;
}
@@ -1178,7 +1188,7 @@ static const struct osmo_fsm_state ipa_asp_states[] = {
static void ipa_asp_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
{
- ipa_asp_fsm_del_route(fi->priv);
+ ipa_asp_fsm_del_route(fi);
}
struct osmo_fsm ipa_asp_fsm = {