pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40175?usp=email )
Change subject: Fix MAP_SCCP_EV_CN_LINK_LOST never dispatched ......................................................................
Fix MAP_SCCP_EV_CN_LINK_LOST never dispatched
Commit introducing event MAP_SCCP_EV_CN_LINK_LOST into the FSM actually never dispatched it, and instead dispatched MAP_SCCP_EV_RAN_LINK_LOST, probably a copy-paste typo. At the same time, it becomes clear no param is passed to the FSM when dispatching it, so update related code paths since it becomes clear no ranap_msg is passed.
Regarding comment in map_sccp_connected_action() about sending a RANAP RESET, that should be done previously through a MAP_SCCP_EV_RX_DATA_INDICATION prior to dispatching the CN_LINK_LOST event if needed, similar to how's done in the context_map_rua FSM.
Fixes: b1c0bb19e2bfbc48e05a89a5f09b476d1243b5f3 Change-Id: I3a37522da16d9a06764f58c2da9579b397d8a7f2 --- M src/osmo-hnbgw/context_map.c M src/osmo-hnbgw/context_map_sccp.c 2 files changed, 1 insertion(+), 15 deletions(-)
Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified 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.c b/src/osmo-hnbgw/context_map.c index 1f4c6a2..5a6d79b 100644 --- a/src/osmo-hnbgw/context_map.c +++ b/src/osmo-hnbgw/context_map.c @@ -186,7 +186,7 @@
void context_map_cnlink_lost(struct hnbgw_context_map *map) { - map_sccp_dispatch(map, MAP_SCCP_EV_RAN_LINK_LOST, NULL); + map_sccp_dispatch(map, MAP_SCCP_EV_CN_LINK_LOST, NULL); }
void context_map_free(struct hnbgw_context_map *map) diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c index 42a0e49..c8973ce 100644 --- a/src/osmo-hnbgw/context_map_sccp.c +++ b/src/osmo-hnbgw/context_map_sccp.c @@ -196,7 +196,6 @@
static void map_sccp_init_action(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - struct hnbgw_context_map *map = fi->priv; struct msgb *ranap_msg = NULL;
switch (event) { @@ -212,10 +211,6 @@ case MAP_SCCP_EV_RAN_LINK_LOST: case MAP_SCCP_EV_USER_ABORT: case MAP_SCCP_EV_CN_LINK_LOST: - ranap_msg = data; - /* No CR has been sent yet, just go to disconnected state. */ - if (msg_has_l2_data(ranap_msg)) - LOG_MAP(map, DLSCCP, LOGL_ERROR, "SCCP not connected, cannot dispatch RANAP message\n"); map_sccp_fsm_state_chg(MAP_SCCP_ST_DISCONNECTED); return;
@@ -259,10 +254,6 @@ case MAP_SCCP_EV_RAN_LINK_LOST: case MAP_SCCP_EV_USER_ABORT: case MAP_SCCP_EV_CN_LINK_LOST: - ranap_msg = data; - /* RUA connection was terminated. First wait for the CC before releasing the SCCP conn. */ - if (msg_has_l2_data(ranap_msg)) - LOGPFSML(fi, LOGL_ERROR, "Connection not yet confirmed, cannot forward RANAP to CN\n"); map->please_disconnect = true; return;
@@ -341,12 +332,7 @@ case MAP_SCCP_EV_USER_ABORT: /* The user is asking for disconnection, so there is no Iu Release in progress. Disconnect now. */ case MAP_SCCP_EV_CN_LINK_LOST: - ranap_msg = data; /* The CN peer has sent a RANAP RESET, so the old link that this map ran on is lost */ - - /* There won't be any ranap_msg, but if a caller wants to dispatch a msg, forward it before - * disconnecting. */ - tx_sccp_df1(fi, ranap_msg); tx_sccp_rlsd(fi); map_sccp_fsm_state_chg(MAP_SCCP_ST_DISCONNECTED); return;