pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40162?usp=email )
Change subject: rua: Handle event TX_DIRECT_TRANSFER in disconnected state discarding msg ......................................................................
rua: Handle event TX_DIRECT_TRANSFER in disconnected state discarding msg
Related: SYS#7452 Change-Id: Id68f219ce776fbbfaa80d3b3ed976f48bef4f883 --- M src/osmo-hnbgw/context_map_rua.c 1 file changed, 22 insertions(+), 4 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved osmith: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve
diff --git a/src/osmo-hnbgw/context_map_rua.c b/src/osmo-hnbgw/context_map_rua.c index d408ddd..e84ce65 100644 --- a/src/osmo-hnbgw/context_map_rua.c +++ b/src/osmo-hnbgw/context_map_rua.c @@ -276,10 +276,27 @@
static void map_rua_disconnected_action(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - struct msgb *ranap_msg = data; - if (msg_has_l2_data(ranap_msg)) - LOGPFSML(fi, LOGL_NOTICE, "RUA not connected, cannot dispatch RANAP message\n"); - /* Ignore all events. */ + struct msgb *ranap_msg; + + switch (event) { + + case MAP_RUA_EV_TX_DIRECT_TRANSFER: + /* This can happen if CN is buggy, or in general if there was a race + * condition between us forwarding the release towards CN (SCCP Release + * or RANAP Iu-ReleaseComplete) and CN sendig whatever to us. */ + ranap_msg = data; + if (msg_has_l2_data(ranap_msg)) { + LOGPFSML(fi, LOGL_NOTICE, "RUA already disconnected, skip forwarding DL RANAP msg (%u bytes)\n", + msgb_l2len(ranap_msg)); + LOGPFSML(fi, LOGL_DEBUG, "%s\n", osmo_hexdump(msgb_l2(ranap_msg), msgb_l2len(ranap_msg))); + } + break; + + case MAP_RUA_EV_CN_DISC: + case MAP_RUA_EV_HNB_LINK_LOST: + /* Ignore events. */ + break; + } }
static void map_rua_disrupted_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) @@ -331,6 +348,7 @@ [MAP_RUA_ST_DISCONNECTED] = { .name = "disconnected", .in_event_mask = 0 + | S(MAP_RUA_EV_TX_DIRECT_TRANSFER) | S(MAP_RUA_EV_CN_DISC) | S(MAP_RUA_EV_HNB_LINK_LOST) ,