From c286a110544a92be6c16a8bb730d660d53953805 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 30 Aug 2021 11:08:31 +0200 Subject: vty: Fix wrong TSC sent when activating lchan through VTY TSC was initially set to -1 (to be picked by callee), but erased when using designated initializers later on in the function, hence TSC being set to 0. As a result, TSC 0 would be requested to the BTS, which may have configured a different BSIC containing BCC!=0. Related: OS#5219 Change-Id: I26813561ee9e7783a4004f32225f19296bd6319c --- src/osmo-bsc/bsc_vty.c | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 5ce1d6978..17fdb45ca 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -1588,47 +1588,25 @@ static int lchan_act_single(struct vty *vty, struct gsm_lchan *lchan, const char /* configure the lchan */ lchan_select_set_type(lchan, lchan_t); if (!strcmp(codec_str, "hr") || !strcmp(codec_str, "fr")) { - info = (struct lchan_activate_info) { - .activ_for = ACTIVATE_FOR_VTY, - .ch_mode_rate = { - .chan_mode = GSM48_CMODE_SPEECH_V1, - }, - .requires_voice_stream = false, - }; + info.ch_mode_rate.chan_mode = GSM48_CMODE_SPEECH_V1; } else if (!strcmp(codec_str, "efr")) { - info = (struct lchan_activate_info) { - .activ_for = ACTIVATE_FOR_VTY, - .ch_mode_rate = { - .chan_mode = GSM48_CMODE_SPEECH_EFR, - }, - .requires_voice_stream = false, - }; + info.ch_mode_rate.chan_mode = GSM48_CMODE_SPEECH_EFR; } else if (!strcmp(codec_str, "amr")) { if (amr_mode == -1) { vty_out(vty, "%% AMR requires specification of AMR mode%s", VTY_NEWLINE); return CMD_WARNING; } - info = (struct lchan_activate_info) { - .activ_for = ACTIVATE_FOR_VTY, - .ch_mode_rate = { - .chan_mode = GSM48_CMODE_SPEECH_AMR, - .s15_s0 = amr_modes[amr_mode], - }, - .requires_voice_stream = false, - }; + info.ch_mode_rate.chan_mode = GSM48_CMODE_SPEECH_AMR; + info.ch_mode_rate.s15_s0 = amr_modes[amr_mode]; } else if (!strcmp(codec_str, "sig")) { - info = (struct lchan_activate_info) { - .activ_for = ACTIVATE_FOR_VTY, - .ch_mode_rate = { - .chan_mode = GSM48_CMODE_SIGN, - }, - .requires_voice_stream = false, - }; + info.ch_mode_rate.chan_mode = GSM48_CMODE_SIGN; } else { vty_out(vty, "%% Invalid channel mode specified!%s", VTY_NEWLINE); return CMD_WARNING; } + info.activ_for = ACTIVATE_FOR_VTY; + info.requires_voice_stream = false; info.ch_mode_rate.chan_rate = chan_t_to_chan_rate(lchan_t); if (activate == 2 || lchan->vamos.is_secondary) { -- cgit v1.2.3