This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/19818 )
Change subject: ctrl: Fix CTRL TRAP for {msc.X,msc_)connection_status not sent
......................................................................
ctrl: Fix CTRL TRAP for {msc.X,msc_)connection_status not sent
The tx TRAP callback is triggered through a signal which is never sent in
osmo-bsc code, and never was as far as I can tell going quite far in the
logs.
In the meanwhile, the msc_connection_status was left in favour of
multi-msc msc.X.connection_status CTRL variable, so let's prepre the cb
function to work for that onei too, dropping global variables which may lead
to wrong output in multi-msc environments, and simply use msc->nr==0 for
the old variable "msc_connection_status".
The signal is now triggered in a_reset when the A conn becomes connected
or disconnected. As a result, a user waiting for the disconnect event
may notice that the status may be changed with a noticeable delay, since
the A conn may be reset only due to high layer timeouts after several
repeated failures (T4, BAD_CONNECTION_THRESOLD).
Related: OS#2623
Related: OS#4701
Related: SYS#5046
Change-Id: I645d198e8e1acd0aba09d05cb3ae90443946acf8
---
M src/osmo-bsc/a_reset.c
M src/osmo-bsc/osmo_bsc_ctrl.c
2 files changed, 20 insertions(+), 9 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/osmo-bsc/a_reset.c b/src/osmo-bsc/a_reset.c
index 713be86..9446d13 100644
--- a/src/osmo-bsc/a_reset.c
+++ b/src/osmo-bsc/a_reset.c
@@ -22,12 +22,14 @@
#include <osmocom/core/utils.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/fsm.h>
+#include <osmocom/core/signal.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <osmocom/bsc/debug.h>
#include <osmocom/bsc/bsc_msc_data.h>
#include <osmocom/bsc/osmo_bsc_sigtran.h>
+#include <osmocom/bsc/signal.h>
#define RESET_RESEND_INTERVAL 2 /* sec */
#define RESET_RESEND_TIMER_NO 4 /* See also 3GPP TS 48.008 Chapter 3.1.4.1.3.1 */
@@ -83,8 +85,10 @@
struct bsc_msc_data *msc = reset_ctx->priv;
LOGPFSML(fi, LOGL_NOTICE, "BSSMAP MSC assocation is down, reconnecting...\n");
- if (prev_state != ST_DISC)
+ if (prev_state != ST_DISC) {
osmo_stat_item_dec(msc->msc_statg->items[MSC_STAT_MSC_LINKS_ACTIVE], 1);
+ osmo_signal_dispatch(SS_MSC, S_MSC_LOST, msc);
+ }
}
/* Connected state event handler */
@@ -116,8 +120,10 @@
struct bsc_msc_data *msc = reset_ctx->priv;
LOGPFSML(fi, LOGL_NOTICE, "BSSMAP MSC assocation is up.\n");
- if (prev_state != ST_CONN)
+ if (prev_state != ST_CONN) {
osmo_stat_item_inc(msc->msc_statg->items[MSC_STAT_MSC_LINKS_ACTIVE], 1);
+ osmo_signal_dispatch(SS_MSC, S_MSC_CONNECTED, msc);
+ }
}
/* Timer callback to retransmit the reset signal */
diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c
index 5ebe597..05bc86c 100644
--- a/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -195,7 +195,6 @@
/* Backwards compat. */
CTRL_CMD_DEFINE_RO(msc0_connection_status, "msc_connection_status");
-static int msc_connection_status = 0; /* XXX unused */
static int get_msc0_connection_status(struct ctrl_cmd *cmd, void *data)
{
@@ -214,13 +213,12 @@
{
struct ctrl_cmd *cmd;
struct gsm_network *gsmnet = (struct gsm_network *)handler_data;
+ struct bsc_msc_data *msc = (struct bsc_msc_data *)signal_data;
- if (signal == S_MSC_LOST && msc_connection_status == 1) {
+ if (signal == S_MSC_LOST) {
LOGP(DCTRL, LOGL_DEBUG, "MSC connection lost, sending TRAP.\n");
- msc_connection_status = 0;
- } else if (signal == S_MSC_CONNECTED && msc_connection_status == 0) {
+ } else if (signal == S_MSC_CONNECTED) {
LOGP(DCTRL, LOGL_DEBUG, "MSC connection (re)established, sending TRAP.\n");
- msc_connection_status = 1;
} else {
return 0;
}
@@ -232,12 +230,19 @@
}
cmd->id = "0";
- cmd->variable = "msc_connection_status";
+ cmd->variable = talloc_asprintf(cmd, "msc.%d.connection_status", msc->nr);
+ cmd->node = msc;
- get_msc0_connection_status(cmd, NULL);
+ get_msc_connection_status(cmd, NULL);
ctrl_cmd_send_to_all(gsmnet->ctrl, cmd);
+ if (msc->nr == 0) {
+ /* Backwards compat. */
+ cmd->variable = "msc_connection_status";
+ ctrl_cmd_send_to_all(gsmnet->ctrl, cmd);
+ }
+
talloc_free(cmd);
return 0;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/19818
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I645d198e8e1acd0aba09d05cb3ae90443946acf8
Gerrit-Change-Number: 19818
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200826/b9a2b307/attachment.htm>