diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-12-07 19:36:54 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-12-07 19:36:57 +0100 |
commit | 65741dca056e3a16973ad156dd4c09760a6a945b (patch) | |
tree | 2082d2dc8d2f3db250277d104ba8f3e9de9997be /src/xua_asp_fsm.c | |
parent | 04ca01eaeb28a32670aa23898bab5c2d186851af (diff) |
ipa: Fix client setting unit_id with ASP name instead of AS
This was broken since ever. The client was submitting the ASP name
in the unit_id field during IPA handshake, and the server was
expecting it to contain the AS, so it failed with message:
"Cannot find any definition for IPA Unit Name '%s'" in
ipa_asp_fsm_wait_id_resp().
Fixes: 5f0a8df34cae20455a520c3a85cf94124f486bf2
Change-Id: I249964e171f578726439c40e01ae85aa447afada
Diffstat (limited to 'src/xua_asp_fsm.c')
-rw-r--r-- | src/xua_asp_fsm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c index 2d81bc3..cc94ac7 100644 --- a/src/xua_asp_fsm.c +++ b/src/xua_asp_fsm.c @@ -1190,10 +1190,16 @@ static struct osmo_fsm_inst *ipa_asp_fsm_start(struct osmo_ss7_asp *asp, { struct osmo_fsm_inst *fi; struct ipa_asp_fsm_priv *iafp; + struct osmo_ss7_as *as = ipa_find_as_for_asp(asp); /* allocate as child of AS? */ fi = osmo_fsm_inst_alloc(&ipa_asp_fsm, asp, NULL, log_level, asp->cfg.name); + if (!as) { + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return NULL; + } + iafp = talloc_zero(fi, struct ipa_asp_fsm_priv); if (!iafp) { osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); @@ -1202,7 +1208,7 @@ static struct osmo_fsm_inst *ipa_asp_fsm_start(struct osmo_ss7_asp *asp, iafp->role = role; iafp->asp = asp; iafp->ipa_unit = talloc_zero(iafp, struct ipaccess_unit); - iafp->ipa_unit->unit_name = talloc_strdup(iafp->ipa_unit, asp->cfg.name); + iafp->ipa_unit->unit_name = talloc_strdup(iafp->ipa_unit, as->cfg.name); iafp->pong_timer.cb = ipa_pong_timer_cb; iafp->pong_timer.data = fi; |