pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38968?usp=email )
Change subject: abis: Fix reusing bts->*_link while it is being destroyed
......................................................................
abis: Fix reusing bts->*_link while it is being destroyed
Call to e1inp_sign_link_destroy() may trigger a sign_down() callback,
which if happening synchronously, could end up reentring the same code
path we are in before bts->*_link was set to NULL.
Avoid it by marking the pointer as NULL immediatelly before calling
e1inp_sign_link_destroy().
Change-Id: Ice71b3143f167482e4a23759012b58e9ee13bfc0
---
M src/osmo-bsc/bts_ipaccess_nanobts.c
1 file changed, 13 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/68/38968/1
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c
index b0532e5..b823dfc 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts.c
@@ -508,12 +508,17 @@
/* These are exported because they are used by the VTY interface. */
void ipaccess_drop_rsl(struct gsm_bts_trx *trx, const char *reason)
{
+ struct e1inp_sign_link *link;
+
if (!trx->rsl_link_primary)
return;
LOG_TRX(trx, DLINP, LOGL_NOTICE, "Dropping RSL link: %s\n", reason);
- e1inp_sign_link_destroy(trx->rsl_link_primary);
+ /* Mark bts->rsl_link_primar ptr null before calling sign_link_destroy,
+ * to avoid a callback triggering this same code path. */
+ link = trx->rsl_link_primary;
trx->rsl_link_primary = NULL;
+ e1inp_sign_link_destroy(link);
osmo_stat_item_dec(osmo_stat_item_group_get_item(trx->bts->bts_statg, BTS_STAT_RSL_CONNECTED), 1);
if (trx->bts->c0 == trx)
@@ -529,6 +534,7 @@
uint8_t i;
struct timespec tp;
int rc;
+ struct e1inp_sign_link *link;
/* First of all, remove deferred drop if enabled */
osmo_timer_del(&bts->oml_drop_link_timer);
@@ -537,8 +543,11 @@
return;
LOG_BTS(bts, DLINP, LOGL_NOTICE, "Dropping OML link: %s\n", reason);
- e1inp_sign_link_destroy(bts->oml_link);
+ /* Mark bts->oml_link ptr null before calling sign_link_destroy,
+ * to avoid a callback triggering this same code path. */
+ link = bts->oml_link;
bts->oml_link = NULL;
+ e1inp_sign_link_destroy(link);
rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp);
bts->updowntime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for downtime */
osmo_stat_item_dec(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_OML_CONNECTED), 1);
@@ -546,8 +555,9 @@
/* Also drop the associated OSMO link */
OSMO_ASSERT(bts->osmo_link);
- e1inp_sign_link_destroy(bts->osmo_link);
+ link = bts->osmo_link;
bts->osmo_link = NULL;
+ e1inp_sign_link_destroy(link);
bts_setup_ramp_remove(bts);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38968?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ice71b3143f167482e4a23759012b58e9ee13bfc0
Gerrit-Change-Number: 38968
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38963?usp=email )
Change subject: bsc: osmo-bsc.cfg: Listen IPA Abis and CTRL interfaces on 127.0.0.1
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38963?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I56c8c6af16502e8f98b28902a251e190da0c0490
Gerrit-Change-Number: 38963
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 27 Nov 2024 19:09:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bts/+/38967?usp=email )
Change subject: abis: Fix reusing bts->*_link while it is being destroyed
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38967?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ibc06cdc2d2cd2028b7676fa0c3211ae251cca587
Gerrit-Change-Number: 38967
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 27 Nov 2024 19:08:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bts/+/38966?usp=email )
Change subject: abis: Log line and ts nr of signal
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38966?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I322633a90566dbd4fae10ab6b1fbbedf55907e8b
Gerrit-Change-Number: 38966
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 27 Nov 2024 19:00:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/38966?usp=email )
Change subject: abis: Log line and ts nr of signal
......................................................................
abis: Log line and ts nr of signal
Change-Id: I322633a90566dbd4fae10ab6b1fbbedf55907e8b
---
M src/common/abis.c
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/66/38966/1
diff --git a/src/common/abis.c b/src/common/abis.c
index 5629cf2..3e0f6dc 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -476,8 +476,11 @@
return 0;
struct input_signal_data *isd = signal_data;
- DEBUGP(DABIS, "Input Signal %s received for link_type=%s\n",
- get_value_string(e1inp_signal_names, signal), e1inp_signtype_name(isd->link_type));
+ DEBUGP(DABIS, "Input Signal %s received for ts-%u-%u link_type=%s\n",
+ get_value_string(e1inp_signal_names, signal),
+ isd->line ? isd->line->num : -1,
+ isd->ts_nr,
+ e1inp_signtype_name(isd->link_type));
return 0;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38966?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I322633a90566dbd4fae10ab6b1fbbedf55907e8b
Gerrit-Change-Number: 38966
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/38967?usp=email )
Change subject: abis: Fix reusing bts->*_link while it is being destroyed
......................................................................
abis: Fix reusing bts->*_link while it is being destroyed
Call to e1inp_sign_link_destroy() may trigger a sign_down() callback,
which if happening synchronously, could end up reentring the same code
path we are in before bts->*_link was set to NULL.
Avoid it by marking the pointer as NULL immediatelly before calling
e1inp_sign_link_destroy().
Change-Id: Ibc06cdc2d2cd2028b7676fa0c3211ae251cca587
---
M src/common/abis.c
1 file changed, 16 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/38967/1
diff --git a/src/common/abis.c b/src/common/abis.c
index 3e0f6dc..e619ec8 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -87,10 +87,17 @@
static void reset_oml_link(struct gsm_bts *bts)
{
+ struct e1inp_sign_link *link;
+
if (bts->oml_link) {
struct timespec now;
- e1inp_sign_link_destroy(bts->oml_link);
+ /* Mark bts->oml_link ptr null before calling sign_link_destroy,
+ * to avoid a callback triggering this same code path. */
+ link = bts->oml_link;
+ bts->oml_link = NULL;
+
+ e1inp_sign_link_destroy(link);
/* Log a special notice if the OML connection was dropped relatively quickly. */
if (bts->oml_conn_established_timestamp.tv_sec != 0 && clock_gettime(CLOCK_MONOTONIC, &now) == 0 &&
@@ -100,14 +107,16 @@
"A common error is a mismatch between unit_id configuration parameters of BTS and BSC.\n",
(uint64_t) (now.tv_sec - bts->oml_conn_established_timestamp.tv_sec));
}
- bts->oml_link = NULL;
}
memset(&bts->oml_conn_established_timestamp, 0, sizeof(bts->oml_conn_established_timestamp));
/* Same for IPAC_PROTO_OSMO on the same ipa connection: */
if (bts->osmo_link) {
- e1inp_sign_link_destroy(bts->osmo_link);
+ /* Mark bts->osmo_link ptr null before calling sign_link_destroy,
+ * to avoid a callback triggering this same code path. */
+ link = bts->osmo_link;
bts->osmo_link = NULL;
+ e1inp_sign_link_destroy(link);
}
}
@@ -226,8 +235,11 @@
/* Then iterate over the RSL signalling links */
llist_for_each_entry(trx, &bts->trx_list, list) {
if (trx->bb_transc.rsl.link) {
- e1inp_sign_link_destroy(trx->bb_transc.rsl.link);
+ /* Mark link ptr null before calling sign_link_destroy,
+ * to avoid a callback triggering this same code path. */
+ struct e1inp_sign_link *link = trx->bb_transc.rsl.link;
trx->bb_transc.rsl.link = NULL;
+ e1inp_sign_link_destroy(link);
if (trx == trx->bts->c0)
load_timer_stop(trx->bts);
} else {
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38967?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ibc06cdc2d2cd2028b7676fa0c3211ae251cca587
Gerrit-Change-Number: 38967
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38965?usp=email )
Change subject: e1_input: Fix e1i_ts pointing to old line after line_clone
......................................................................
e1_input: Fix e1i_ts pointing to old line after line_clone
Change-Id: I8f8e1fd67a63b46d59f433ad01bb2ab880cdf910
---
M src/e1_input.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/65/38965/1
diff --git a/src/e1_input.c b/src/e1_input.c
index 145fccf..76adbd9 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -675,6 +675,10 @@
OSMO_ASSERT(clone->sock_path);
}
+ /* Update TS to point to the cloned line: */
+ for (unsigned int i = 0; i < line->num_ts; i++)
+ clone->ts[i].line = clone;
+
/*
* Rate counters and driver data are shared between clones. These are pointers
* to dynamic memory so we use reference counting to avoid a double-free (see OS#3137).
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38965?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I8f8e1fd67a63b46d59f433ad01bb2ab880cdf910
Gerrit-Change-Number: 38965
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: dexter.
pespin has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38964?usp=email )
Change subject: PCUIF: fix usage of bts number in PCUIF_TXT_IND
......................................................................
Patch Set 1:
(1 comment)
File bts/BTS_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38964/comment/64d211fb_63f5… :
PS1, Line 5449: /* At this point, a real PCU would not have any BTS context yet. This means that the receiving process is
I'm failing to see the relation between "PCU not having any BTS contenxt yet" and the fact that we send a "0" in the field because we need to send whatever anywyay...
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38964?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I93de261fc77806b2f817e0d30cb1b0d377ed0dbb
Gerrit-Change-Number: 38964
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 27 Nov 2024 17:28:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38964?usp=email )
Change subject: PCUIF: fix usage of bts number in PCUIF_TXT_IND
......................................................................
PCUIF: fix usage of bts number in PCUIF_TXT_IND
When we receive the PCU_VERSION using tr_PCUIF_TXT_IND we must ignore the
included BTS number because the PCU_VERSION is not addressed to a specific
BTS. When we send a PCU_VERSION using ts_PCUIF_TXT_IND, we should always
use the bts number 0 to be consistent (the BSC/BTS will ignore this number
anyway).
Let's fix the usage of tr_PCUIF_TXT_IND and put comments, to make clear why
the above applies.
Change-Id: I93de261fc77806b2f817e0d30cb1b0d377ed0dbb
related: OS#6507
---
M bts/BTS_Tests.ttcn
M bts/BTS_Tests_OML.ttcn
M pcu/PCUIF_Components.ttcn
M pcu/PCU_Tests_NS.ttcn
4 files changed, 10 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/38964/1
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1ba8d53..186d273 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -5446,6 +5446,8 @@
f_init();
map(self:PCU, system:PCU);
f_init_pcu(PCU, testcasename(), g_pcu_conn_id, g_pcu_last_info);
+ /* At this point, a real PCU would not have any BTS context yet. This means that the receiving process is
+ * expected to ignore the BTS number (0) we use when sending the PCU_VERSION. */
PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_VERSION, testcasename())));
}
diff --git a/bts/BTS_Tests_OML.ttcn b/bts/BTS_Tests_OML.ttcn
index 980643a..e34a5f7 100644
--- a/bts/BTS_Tests_OML.ttcn
+++ b/bts/BTS_Tests_OML.ttcn
@@ -150,6 +150,8 @@
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for PCU INFO_IND");
}
}
+ /* At this point, a real PCU would not have any BTS context yet. This means that the receiving process is
+ * expected to ignore the BTS number (0) we use when sending the PCU_VERSION. */
pt.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_VERSION, testcasename())));
}
diff --git a/pcu/PCUIF_Components.ttcn b/pcu/PCUIF_Components.ttcn
index 6e956ba..db181b9 100644
--- a/pcu/PCUIF_Components.ttcn
+++ b/pcu/PCUIF_Components.ttcn
@@ -503,8 +503,9 @@
PCUIF.receive(tr_RAW_PCU_EV(PCU_EV_CONNECT));
alt {
- /* Wait for TXT.ind (PCU_VERSION) and respond with INFO.ind (SI13) */
- [] PCUIF.receive(tr_PCUIF_TXT_IND(bts_nr, PCU_VERSION, ?)) -> value pcu_msg {
+ /* Wait for TXT.ind (PCU_VERSION) and respond with INFO.ind (SI13). Since the PCU does not have any BTS context
+ * at this point, we will ignore the BTS number in this TXT indication. */
+ [] PCUIF.receive(tr_PCUIF_TXT_IND(?, PCU_VERSION, ?)) -> value pcu_msg {
log("Rx TXT.ind from the PCU, version is ", pcu_msg.u.txt_ind.text);
/* Send System Information 13 to the PCU */
diff --git a/pcu/PCU_Tests_NS.ttcn b/pcu/PCU_Tests_NS.ttcn
index eea8d3f..fad9047 100644
--- a/pcu/PCU_Tests_NS.ttcn
+++ b/pcu/PCU_Tests_NS.ttcn
@@ -55,8 +55,9 @@
g_pcu_conn_id := f_pcuif_listen(PCU, mp_pcu_sock_path);
PCU.receive(UD_connected:?);
- /* Wait for PCU_VERSION and return INFO_IND */
- PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?)));
+ /* Wait for PCU_VERSION and return INFO_IND. Since the PCU does not have any BTS context at this point, we will
+ * ignore the BTS number in this TXT indication. */
+ PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(?, PCU_VERSION, ?)));
/* FIXME: make sure to use parameters from mp_gb_cfg.bvc[0].cell_id in the PCU INFO IND */
var template PCUIF_Message info_ind_msg := ts_PCUIF_INFO_IND(0, info_ind);
PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind_msg));
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38964?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I93de261fc77806b2f817e0d30cb1b0d377ed0dbb
Gerrit-Change-Number: 38964
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38963?usp=email )
Change subject: bsc: osmo-bsc.cfg: Listen IPA Abis and CTRL interfaces on 127.0.0.1
......................................................................
bsc: osmo-bsc.cfg: Listen IPA Abis and CTRL interfaces on 127.0.0.1
CTRL seems to bind to 127.0.0.1 by default, but IPA Abis listents to
0.0.0.0 by default, which is not needed and may create problems with
concurrent instances.
Change-Id: I56c8c6af16502e8f98b28902a251e190da0c0490
---
M bsc/osmo-bsc.cfg
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/63/38963/1
diff --git a/bsc/osmo-bsc.cfg b/bsc/osmo-bsc.cfg
index 958db6a..a03aeaf 100644
--- a/bsc/osmo-bsc.cfg
+++ b/bsc/osmo-bsc.cfg
@@ -45,11 +45,14 @@
line vty
no login
bind 127.0.0.1
+ctrl
+ bind 127.0.0.1
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
+ ipa bind 127.0.0.1
cs7 instance 0
asp asp-clnt-msc-0 2905 1905 m3ua
remote-ip 127.0.0.1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38963?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I56c8c6af16502e8f98b28902a251e190da0c0490
Gerrit-Change-Number: 38963
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>