pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40174?usp=email )
Change subject: cosmetic: context_map.h: Document parameters of all map_sccp_fsm_event values
......................................................................
cosmetic: context_map.h: Document parameters of all map_sccp_fsm_event values
Change-Id: I53603ade5157ddbccb49864a2edab09376fe8979
---
M include/osmocom/hnbgw/context_map.h
1 file changed, 12 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/74/40174/1
diff --git a/include/osmocom/hnbgw/context_map.h b/include/osmocom/hnbgw/context_map.h
index 7e288d7..9791954 100644
--- a/include/osmocom/hnbgw/context_map.h
+++ b/include/osmocom/hnbgw/context_map.h
@@ -54,13 +54,14 @@
* MAP_SCCP_EV_TX_DATA_REQUEST, MAP_SCCP_EV_RAN_DISC.
*/
enum map_sccp_fsm_event {
- /* Receiving an SCCP CC from CN. */
+ /* Receiving an SCCP CC from CN.
+ * Parameter: struct msgb *ranap_msg */
MAP_SCCP_EV_RX_CONNECTION_CONFIRM,
/* Receiving some data from CN via SCCP, to forward via RUA to HNB.
- * Parameter: struct msgb *ranap_msg */
+ * Parameter: struct msgb *ranap_msg, may be NULL or empty. */
MAP_SCCP_EV_RX_DATA_INDICATION,
/* RUA has received some data from HNB to forward via SCCP to CN.
- * Parameter: struct msgb *ranap_msg */
+ * Parameter: struct msgb *ranap_msg. */
MAP_SCCP_EV_TX_DATA_REQUEST,
/* 3GPP TS 25.468 9.1.5: The RAN side received a RUA Disconnect.
* - Under normal conditions (cause=Normal) the RUA Disconnect contains a RANAP Iu-ReleaseComplete.
@@ -75,15 +76,19 @@
* happened under error or normal conditions, as per the above.
*/
MAP_SCCP_EV_RAN_DISC,
- /* The RAN released ungracefully. We will directly disconnect the SCCP connection, too. */
+ /* The RAN released ungracefully. We will directly disconnect the SCCP connection, too.
+ * Parameter: no parameter, NULL. */
MAP_SCCP_EV_RAN_LINK_LOST,
- /* Receiving an SCCP RLSD from CN, or libosmo-sigtran tells us about SCCP connection timeout. All done. */
+ /* Receiving an SCCP RLSD from CN, or libosmo-sigtran tells us about SCCP connection timeout. All done.
+ * Parameter: struct msgb *ranap_msg, may be NULL or empty. */
MAP_SCCP_EV_RX_RELEASED,
/* The human admin asks to drop the current SCCP connection, by telnet VTY 'apply sccp' in presence of SCCP
- * config changes. */
+ * 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. */
+ * context map.
+ * Parameter: no parameter, NULL. */
MAP_SCCP_EV_CN_LINK_LOST,
};
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/40174?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I53603ade5157ddbccb49864a2edab09376fe8979
Gerrit-Change-Number: 40174
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40176?usp=email )
Change subject: context_map_sccp: Queue RUA->SCCP RANAP msgs while in SCCP WAIT_CC state
......................................................................
context_map_sccp: Queue RUA->SCCP RANAP msgs while in SCCP WAIT_CC state
HNB transmits the first RANAP PDU over a RUA Connect msg, which creates
the session without need for any confirmation from HNBGW.
As a result, HNB is allowed to transmit more RANAP PDUs after that.
On the other side HNBGW, SCCP conn establishment towards CN consists of
a CREQ msg and then wait until CC (or CREF) is received. HNBGW is unable
to transmit any more data during that time, only the one appended to the
CREQ SCCP msg.
If the RAN transmits any more RANAP PDU over RUA while SCCP side is
still waiting for CC, we were discarding the message. Instead, queue it
and transmit it once finally the CC is received from the peer.
Related: SYS#7453
Change-Id: I307ded905901421f8228fab720b3989a2f94412b
---
M include/osmocom/hnbgw/context_map.h
M src/osmo-hnbgw/context_map_sccp.c
2 files changed, 32 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/76/40176/1
diff --git a/include/osmocom/hnbgw/context_map.h b/include/osmocom/hnbgw/context_map.h
index 469323a..7dd9a1a 100644
--- a/include/osmocom/hnbgw/context_map.h
+++ b/include/osmocom/hnbgw/context_map.h
@@ -164,6 +164,12 @@
uint32_t scu_conn_id;
/* FSM handling the SCCP state for scu_conn_id. */
struct osmo_fsm_inst *sccp_fi;
+ /* State context related to field sccp_fi above: */
+ struct {
+ /* List of cached packets received from RUA and to be forwarded
+ once SCCP CReq is CC'ed and move to CONNECTED state. */
+ struct llist_head wait_cc_tx_msg_list;
+ } sccp_fi_ctx;
/* False for CS, true for PS */
bool is_ps;
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c
index cf57c82..d317e0f 100644
--- a/src/osmo-hnbgw/context_map_sccp.c
+++ b/src/osmo-hnbgw/context_map_sccp.c
@@ -79,7 +79,7 @@
OSMO_ASSERT(map->sccp_fi == NULL);
map->sccp_fi = fi;
-
+ INIT_LLIST_HEAD(&map->sccp_fi_ctx.wait_cc_tx_msg_list);
/* trigger the timeout */
map_sccp_fsm_state_chg(MAP_SCCP_ST_INIT);
}
@@ -193,6 +193,19 @@
return hnbgw_ranap_rx_data_dl(map, ranap_msg);
}
+static void wait_cc_tx_msg_list_enqueue(struct hnbgw_context_map *map, struct msgb *ranap_msg)
+{
+ talloc_steal(map, ranap_msg);
+ msgb_enqueue(&map->sccp_fi_ctx.wait_cc_tx_msg_list, ranap_msg);
+}
+static struct msgb *wait_cc_tx_msg_list_dequeue(struct hnbgw_context_map *map)
+{
+ struct msgb *ranap_msg = msgb_dequeue(&map->sccp_fi_ctx.wait_cc_tx_msg_list);
+ if (ranap_msg)
+ talloc_steal(OTC_SELECT, ranap_msg);
+ return ranap_msg;
+}
+
static void map_sccp_init_action(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct msgb *ranap_msg = NULL;
@@ -245,8 +258,9 @@
return;
case MAP_SCCP_EV_TX_DATA_REQUEST:
- /* ranap_msg = data; */
- LOGPFSML(fi, LOGL_ERROR, "Connection not yet confirmed, cannot forward RANAP to CN\n");
+ ranap_msg = data;
+ LOGPFSML(fi, LOGL_INFO, "Caching RANAP msg from RUA while waiting for SCCP CC\n");
+ wait_cc_tx_msg_list_enqueue(map, ranap_msg);
return;
case MAP_SCCP_EV_RAN_LINK_LOST:
@@ -277,9 +291,15 @@
static void map_sccp_connected_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
{
struct hnbgw_context_map *map = fi->priv;
+ struct msgb *ranap_msg;
+
+ /* Now that SCCP conn is confirmed, forward pending msgs received from RUA side: */
+ while ((ranap_msg = wait_cc_tx_msg_list_dequeue(map)))
+ tx_sccp_df1(fi, ranap_msg);
+
if (map->please_disconnect) {
- /* SCCP has already been asked to disconnect, so disconnect now that the CC has been received. Send RLSD
- * to SCCP (without RANAP data) */
+ /* SCCP has already been asked to disconnect, so disconnect now that the
+ * CC has been received. Send RLSD to SCCP (without RANAP data) */
tx_sccp_rlsd(fi);
map_sccp_fsm_state_chg(MAP_SCCP_ST_DISCONNECTED);
}
@@ -465,6 +485,7 @@
{
struct hnbgw_context_map *map = fi->priv;
map->sccp_fi = NULL;
+ msgb_queue_free(&map->sccp_fi_ctx.wait_cc_tx_msg_list);
}
#define S(x) (1 << (x))
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/40176?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I307ded905901421f8228fab720b3989a2f94412b
Gerrit-Change-Number: 40176
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40175?usp=email )
Change subject: context_map_sccp: Drop unused MAP_SCCP_EV_CN_LINK_LOST
......................................................................
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 https://gerrit.osmocom.org/c/osmo-hnbgw/+/40175?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
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(a)sysmocom.de>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/40171?usp=email )
Change subject: ipaccess: Reset pointer before calling stream_cli func triggering callback
......................................................................
ipaccess: Reset pointer before calling stream_cli func triggering callback
The osmo_stream_cli_destroy() may trigger the disconnect_cb, which we
forward to the user through sign_link_down() callback.
Hence, the user may call e1inp_ipa_bts_rsl_close_n() again (re-entrant,
recursively) before we had time to nullify the pointer, calling
osmo_stream_cli_destroy() again.
Instead, make sure the pointer is reset bfore potentially calling the
osmo_stream_cli_destroy() to make sure to catch this scenario.
This issue was being triggered by BTS_Tests.TC_chopped_ipa_payload,
which was hitting an assert due to incorrectly calling
osmo_stream_cli_destroy() twice on a given stream_cli.
Related: OS#6729
Change-Id: I2f1da24580effab5e3dfeacb6514c3b1e3a650c9
(cherry picked from commit 8076b58f5d7d22cb5dcc82843d1793adbc9ba4e4)
---
M src/input/ipaccess.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 6a7d753..44ec719 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -1168,8 +1168,8 @@
cli = il->ipa_cli[1 + trx_nr];
if (cli != NULL) {
- osmo_stream_cli_destroy(cli);
il->ipa_cli[1 + trx_nr] = NULL;
+ osmo_stream_cli_destroy(cli);
}
return 0;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/40171?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: rel-2.0.1
Gerrit-Change-Id: I2f1da24580effab5e3dfeacb6514c3b1e3a650c9
Gerrit-Change-Number: 40171
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>