From d7e2be6b33b7bcd741df9d9562b7e01c16eb61c3 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 31 Aug 2020 22:28:02 +0200 Subject: 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 --- src/osmo-bsc/cbsp_link.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); + return CMD_SUCCESS; } -- cgit v1.2.3