pespin has uploaded this change for review.

View Change

as: Avoid adding dyn route when IPA AS becomes active

It makes no sense to do so nowadays:
* ASP role: the routing-key PC points to a local PC, and hence it's not
really used during routing.
* SG role: This would only make sense if we somehow supported dynamic IP
AS, which we don't support (only IPA ASP). Hence, the AS is always
configured and hence the user is responsible of filling the routing
table with an appropriate entry towards the peer's DPC.

Change-Id: I8997d40f2a779734432b40d27f9345d9a739d36f
---
M src/xua_as_fsm.c
1 file changed, 0 insertions(+), 78 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/80/40580/1
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index 71049d5..7d8e302 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -265,7 +265,6 @@
struct osmo_timer_list t_r;
struct llist_head queued_xua_msgs;
} recovery;
- bool ipa_route_created;
};

static void fill_notify_statchg_pars(const struct osmo_fsm_inst *fi, struct osmo_xlm_prim_notify *npar)
@@ -291,79 +290,6 @@
}
}

-/* is the given AS one with a single ASP of IPA type? */
-static bool is_single_ipa_asp(struct osmo_ss7_as *as)
-{
- unsigned int asp_count = 0;
- int i;
-
- for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {
- struct osmo_ss7_asp *asp = as->cfg.asps[i];
- if (!asp)
- continue;
- asp_count++;
- if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA)
- return false;
- }
- if (asp_count == 1)
- return true;
- return false;
-}
-
-static void ipa_add_route(struct osmo_fsm_inst *fi)
-{
- struct xua_as_fsm_priv *xafp = (struct xua_as_fsm_priv *) fi->priv;
- struct osmo_ss7_as *as = xafp->as;
- struct osmo_ss7_instance *inst = as->inst;
-
- if (ss7_route_table_find_route_by_dpc_mask(inst->rtable_system,
- as->cfg.routing_key.pc, 0xffffff,
- true))
- return;
-
- /* As opposed to M3UA, there is no RKM and we have to implicitly
- * automatically add a dynamic route once an IPA connection has come up */
- if (ss7_route_create(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff, true, as->cfg.name))
- xafp->ipa_route_created = true;
-}
-
-static void ipa_del_route(struct osmo_fsm_inst *fi)
-{
- struct xua_as_fsm_priv *xafp = (struct xua_as_fsm_priv *) fi->priv;
- struct osmo_ss7_as *as = xafp->as;
- 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 = ss7_route_table_find_route_by_dpc_mask(inst->rtable_system,
- as->cfg.routing_key.pc, 0xffffff,
- true);
- /* no route found, bail out */
- if (!rt) {
- LOGPFSML(fi, LOGL_NOTICE, "Attempting to delete route for this IPA AS, 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) {
- 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;
- }
-
- ss7_route_destroy(rt);
- xafp->ipa_route_created = false;
-}
-
-
-
/* is any other ASP in this AS in state != DOWN? */
static bool check_any_other_asp_not_down(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp_cmp)
{
@@ -583,16 +509,12 @@
/* continue below */
break;
case XUA_AS_S_ACTIVE:
- if (is_single_ipa_asp(as))
- ipa_add_route(fi);
/* continue below */
break;
case XUA_AS_S_PENDING:
/* continue below */
break;
case XUA_AS_S_DOWN:
- if (is_single_ipa_asp(as))
- ipa_del_route(fi);
/* 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

To view, visit change 40580. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I8997d40f2a779734432b40d27f9345d9a739d36f
Gerrit-Change-Number: 40580
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>