Change in libosmo-sccp[master]: xua_as_fsm: Only delete a route for an IPA AS if we created one earlier

laforge gerrit-no-reply at
Thu Apr 29 17:46:46 UTC 2021

laforge has uploaded this change for review. ( )

Change subject: xua_as_fsm: Only delete a route for an IPA AS if we created one earlier

xua_as_fsm: Only delete a route for an IPA AS if we created one earlier

The current code would potentially delete a route that was statically present in the
configuration in the following situation:

* route exists in config
* identical route is attempted to be added at AS-ACTIVE time, but fails
* route is unconditionally deleted at AS-DOWN time
* user now does 'write file' and has lost a route

Let's make sure we only delete the route if we added it previously.

Change-Id: I9ad5f7ebe0790e6c186b8ea1b12f204860a00cd2
Related: SYS#5422
M src/xua_as_fsm.c
1 file changed, 10 insertions(+), 1 deletion(-)

  git pull ssh:// refs/changes/83/23983/1

diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index f66ba88..c198f86 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -200,6 +200,7 @@
 		struct osmo_timer_list t_r;
 		struct llist_head queued_msgs;
 	} recovery;
+	bool ipa_route_created;
 /* is the given AS one with a single ASP of IPA type? */
@@ -227,9 +228,13 @@
 	struct osmo_ss7_as *as = xafp->as;
 	struct osmo_ss7_instance *inst = as->inst;
+	if (osmo_ss7_route_find_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff))
+		return;
 	/* As opposed to M3UA, there is no RKM and we have to implicitly
 	 * automatically add a route once an IPA connection has come up */
-	osmo_ss7_route_create(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff, as->;
+	if (osmo_ss7_route_create(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff, as->
+		xafp->ipa_route_created = true;
 static void ipa_del_route(struct osmo_fsm_inst *fi)
@@ -239,6 +244,10 @@
 	struct osmo_ss7_instance *inst = as->inst;
 	struct osmo_ss7_route *rt;
+	/* don't delete a route if we added none */
+	if (!xafp->ipa_route_created)
+		return;
 	/* 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 */

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I9ad5f7ebe0790e6c186b8ea1b12f204860a00cd2
Gerrit-Change-Number: 23983
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list