neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/37808?usp=email )
Change subject: on RUA DT for unknown context, respond with RUA Disconnect ......................................................................
on RUA DT for unknown context, respond with RUA Disconnect
If we receive a DirectTransfer for an unknown RUA context, respond with a RUA Disconnect to make sure the peer knows there is no such context. (Do not respond to RUA Disconnect though.)
Related: OS#6283 Change-Id: If0b9a999649c9822f55b42b0cae8408af668e1b8 --- M src/osmo-hnbgw/hnbgw_rua.c 1 file changed, 10 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/08/37808/1
diff --git a/src/osmo-hnbgw/hnbgw_rua.c b/src/osmo-hnbgw/hnbgw_rua.c index 7b561df..dc14b2d 100644 --- a/src/osmo-hnbgw/hnbgw_rua.c +++ b/src/osmo-hnbgw/hnbgw_rua.c @@ -228,7 +228,7 @@ struct msgb *ranap_msg = NULL; struct hnbgw_context_map *map = NULL; bool is_ps; - int logl; + RUA_Cause_t rua_cause;
switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: @@ -253,7 +253,6 @@ }
map = context_map_find_by_rua_ctx_id(hnb, context_id, is_ps); - logl = LOGL_ERROR;
switch (rua_procedure) { case RUA_ProcedureCode_id_Connect: @@ -278,14 +277,19 @@ /* For RUA Disconnect, do not spam the ERROR log. It is just a stray Disconnect, no harm done. * Context: some CN are known to rapidly tear down SCCP without waiting for RUA to disconnect gracefully * (IU Release Complete). Such CN would cause ERROR logging for each and every released context map. */ - logl = LOGL_DEBUG; - /* fall thru */ + if (!map) { + LOGHNB(hnb, DRUA, LOGL_DEBUG, "rx RUA %s for unknown RUA context %u\n", + rua_procedure_code_name(rua_procedure), context_id); + return -EINVAL; + } + break; + default: /* Any message other than Connect must have a valid RUA context */ if (!map) { - LOGHNB(hnb, DRUA, logl, "rx RUA %s for unknown RUA context %u\n", + LOGHNB(hnb, DRUA, LOGL_ERROR, "rx RUA %s for unknown RUA context %u\n", rua_procedure_code_name(rua_procedure), context_id); - return -EINVAL; + goto tx_disconnect; } break; }