pespin has uploaded this change for review.

View Change

context_map_sccp: Drop unused MAP_SCCP_EV_CN_LINK_LOST

This event is never called. Furthermore, this kind of "SCCP link went
down" should already be handled by libosmo-sigtran's sccp SAP
internally, and we should simply recieve an N-DISCONNECT.ind when that
happens which dispatches event MAP_SCCP_EV_RX_RELEASED.

When doing so, it becomes easier to find out that some code paths in the
map_sccp_fsm handle events which don't expect any kind of ranap_msg as
parameter, so simplify those.

Related: OS#6085
Change-Id: I3a37522da16d9a06764f58c2da9579b397d8a7f2
---
M include/osmocom/hnbgw/context_map.h
M src/osmo-hnbgw/context_map_sccp.c
2 files changed, 0 insertions(+), 28 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/75/40175/1
diff --git a/include/osmocom/hnbgw/context_map.h b/include/osmocom/hnbgw/context_map.h
index 9791954..469323a 100644
--- a/include/osmocom/hnbgw/context_map.h
+++ b/include/osmocom/hnbgw/context_map.h
@@ -86,10 +86,6 @@
* config changes.
* Parameter: no parameter, NULL. */
MAP_SCCP_EV_USER_ABORT,
- /* The CN link can no longer work, for example a RANAP RESET was received from the cnlink that hosts this
- * context map.
- * Parameter: no parameter, NULL. */
- MAP_SCCP_EV_CN_LINK_LOST,
};

/* For context_map_get_state(), to combine the RUA and SCCP states, for VTY reporting only. */
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c
index 42a0e49..cf57c82 100644
--- a/src/osmo-hnbgw/context_map_sccp.c
+++ b/src/osmo-hnbgw/context_map_sccp.c
@@ -48,7 +48,6 @@
OSMO_VALUE_STRING(MAP_SCCP_EV_RAN_LINK_LOST),
OSMO_VALUE_STRING(MAP_SCCP_EV_RX_RELEASED),
OSMO_VALUE_STRING(MAP_SCCP_EV_USER_ABORT),
- OSMO_VALUE_STRING(MAP_SCCP_EV_CN_LINK_LOST),
{}
};

@@ -196,7 +195,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) {
@@ -211,11 +209,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;

@@ -258,11 +251,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;

@@ -340,13 +328,7 @@
* Disconnect on the SCCP layer, ungracefully. */
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;
@@ -418,7 +400,6 @@

case MAP_SCCP_EV_RAN_LINK_LOST:
case MAP_SCCP_EV_USER_ABORT:
- case MAP_SCCP_EV_CN_LINK_LOST:
case MAP_SCCP_EV_RAN_DISC:
/* Stop waiting for RLSD, send RLSD now. */
tx_sccp_rlsd(fi);
@@ -497,7 +478,6 @@
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_RELEASED)
| S(MAP_SCCP_EV_USER_ABORT)
- | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_INIT)
@@ -515,7 +495,6 @@
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_RELEASED)
| S(MAP_SCCP_EV_USER_ABORT)
- | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_CONNECTED)
@@ -533,7 +512,6 @@
| S(MAP_SCCP_EV_RX_RELEASED)
| S(MAP_SCCP_EV_RX_CONNECTION_CONFIRM)
| S(MAP_SCCP_EV_USER_ABORT)
- | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_WAIT_RLSD)
@@ -552,7 +530,6 @@
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_CONNECTION_CONFIRM)
| S(MAP_SCCP_EV_USER_ABORT)
- | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_DISCONNECTED)
@@ -567,7 +544,6 @@
| S(MAP_SCCP_EV_RAN_DISC)
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_USER_ABORT)
- | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.onenter = map_sccp_disconnected_onenter,
.action = map_sccp_disconnected_action,

To view, visit change 40175. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I3a37522da16d9a06764f58c2da9579b397d8a7f2
Gerrit-Change-Number: 40175
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>