diff options
author | Harald Welte <laforge@osmocom.org> | 2023-04-15 20:15:39 +0800 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2023-04-15 20:34:33 +0800 |
commit | 460ba631b5922dda228b5d1b7dd5b01ff3a3132a (patch) | |
tree | bdcadad61ae09a31b6038e04e8f312887262b857 /src/xua_asp_fsm.c | |
parent | a54c714df3661468dedc034bede86e5da1bcaa5d (diff) |
ASPAC/ASPIA: Don't add routing context IE in ASP-role if routing context 0
If there is only one routing key (and hence routing context, and hence
AS) within one ASP, *and* the routing context is configured as 0 (zero),
we should not include the routing context IE. This is the way how
libosmo-sigtran has always been special-casing routing context 0 meaning
"routing context is not used". However, that was only working in SG
role (typical STP use case). When operating in ASP role, the
special-case handling was missing, causing a routing context IE
containing zero to be included in the related transmitted M3UA ASPAC
and ASPIA messages.
Change-Id: I5ce89b393a3b950ab7fd1eace9038718c9efcc51
Closes: OS#6003
Diffstat (limited to 'src/xua_asp_fsm.c')
-rw-r--r-- | src/xua_asp_fsm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c index a93dbd2..0080497 100644 --- a/src/xua_asp_fsm.c +++ b/src/xua_asp_fsm.c @@ -181,8 +181,15 @@ static int xua_msg_add_asp_rctx(struct xua_msg *xua, struct osmo_ss7_asp *asp) } } /* add xUA IE with routing contests to the message (if any) */ - if (i) + if (i) { + /* bail out (and not add the IE) if there's only one routing context (and hence + * only one AS) within this ASP, and that routing context is zero, meaning no routing + * context IE shall be used */ + if (i == 1 && rctx[0] == 0) + return 0; + xua_msg_add_data(xua, M3UA_IEI_ROUTE_CTX, i*sizeof(uint32_t), (uint8_t *)rctx); + } /* return count of routing contexts added */ return i; |