diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2020-08-31 22:28:02 +0200
committerneels <nhofmeyr@sysmocom.de>2020-08-31 20:46:02 +0000
commitd7e2be6b33b7bcd741df9d9562b7e01c16eb61c3 (patch)
parent4d2668823916e2998016f72f06452fcd51068c71 (diff)
CBSP: fix link startup when enabled in config file
Restart the CBSP link from the VTY only from telnet sessions, not when reading in the config file. When reading the config file, link startup might happen too early and twice -- rather rely only on the CBSP startup invoked from main(). This is fixing a bug introduced recently in "CBSP: rewrite the CBSP link setup and 'cbc' VTY section" commit 641f7f08450f2d0c4b8e8a9f6a36b0a6b2788816 Change-Id Icaa2775cc20a99227dabe38a775ff808b374cf98 Change-Id: Ia0bb507c8468048789a446df09185ad8565c5ad8
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osmo-bsc/cbsp_link.c b/src/osmo-bsc/cbsp_link.c
index e5e72ded6..f4cdbb727 100644
--- a/src/osmo-bsc/cbsp_link.c
+++ b/src/osmo-bsc/cbsp_link.c
@@ -347,7 +347,12 @@ DEFUN(cfg_cbc_mode, cfg_cbc_mode_cmd,
struct bsc_cbc_link *cbc = vty_cbc_data(vty);
cbc->mode = get_string_value(bsc_cbc_link_mode_names, argv[0]);
OSMO_ASSERT(cbc->mode >= 0);
- bsc_cbc_link_restart();
+ /* Immediately restart/stop CBSP only when coming from a telnet session. The settings from the config file take
+ * effect in osmo_bsc_main.c's invocation of bsc_cbc_link_restart(). */
+ if (vty->type != VTY_FILE)
+ bsc_cbc_link_restart();