aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-04-25 17:28:28 +0200
committerlaforge <laforge@osmocom.org>2021-04-26 08:54:09 +0000
commit37a3b1f07dc959c21db2b7bcebae842ecf88b054 (patch)
tree88a41168761f43e77b12f1f4af0dbc7491bfcc5b
parent8a43eb418664fbcd0879f2c776f03a1dff7c584d (diff)
ipa_asp_fsm: Fix AS lookup from IPA ASP
Contrary to proper SIGTRAN, IPA/SCCPlite cannot support multiple AS within one ASP. When looking up the AS from the ASP, we cannot blindly use routing context 0 to find the AS, as there may very well be multiple IPA AS, and all of those have routing context 0. As a result, the exiting look-up by osmo_ss7_as_find_by_rctx(inst, 0) will return the wrong AS, and we will try to add/delete routes for a completely different AS when ASPs are coming up or going down. Instead, we need to use xua_find_as_for_asp() in order do the look-up: It will resolve the single AS within the ASP. Change-Id: Id295daf84f6ba1cc56cbe1761f874bea329e17ea Cloess: SYS#5422
-rw-r--r--src/xua_asp_fsm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 4630f5b..f8683d5 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -29,6 +29,7 @@
#include "xua_asp_fsm.h"
#include "xua_as_fsm.h"
+#include "xua_internal.h"
#define S(x) (1 << (x))
@@ -941,9 +942,9 @@ static void ipa_asp_fsm_wait_id_ack2(struct osmo_fsm_inst *fi, uint32_t event, v
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 */
- struct osmo_ss7_as *as = osmo_ss7_as_find_by_rctx(inst, 0);
+ struct osmo_ss7_as *as;
+ xua_find_as_for_asp(&as, asp, NULL);
OSMO_ASSERT(as);
switch (event) {
@@ -1015,10 +1016,10 @@ 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 */
- struct osmo_ss7_as *as = osmo_ss7_as_find_by_rctx(inst, 0);
+ struct osmo_ss7_as *as;
struct osmo_ss7_route *rt;
+ xua_find_as_for_asp(&as, asp, NULL);
OSMO_ASSERT(as);
/* find the route which we have created if we ever reached ipa_asp_fsm_wait_id_ack2 */