aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-08-30 11:08:31 +0200
committerpespin <pespin@sysmocom.de>2021-08-31 08:14:46 +0000
commitc286a110544a92be6c16a8bb730d660d53953805 (patch)
treea068d5717edae3fa3aec39084666e617213da677
parenta268523e3d11384e0aa5d76b6f4067aad73d3aee (diff)
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
-rw-r--r--src/osmo-bsc/bsc_vty.c36
1 files 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) {