Change in osmo-bsc[master]: vty: Fix wrong TSC sent when activating lchan through VTY

pespin gerrit-no-reply at lists.osmocom.org
Mon Aug 30 09:22:50 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/25278 )


Change subject: vty: Fix wrong TSC sent when activating lchan through VTY
......................................................................

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: SYS#5219
Change-Id: I26813561ee9e7783a4004f32225f19296bd6319c
---
M src/osmo-bsc/bsc_vty.c
1 file changed, 10 insertions(+), 29 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/25278/1

diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 6d10426..4fb2434 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -1587,47 +1587,28 @@
 		/* 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;
+			info.requires_voice_stream = false;
 		} 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;
+			info.requires_voice_stream = false;
 		} 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];
+			info.requires_voice_stream = false;
 		} 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;
+			info.requires_voice_stream = false;
 		} else {
 			vty_out(vty, "%% Invalid channel mode specified!%s", VTY_NEWLINE);
 			return CMD_WARNING;
 		}
 
+		info.activ_for = ACTIVATE_FOR_VTY;
 		info.ch_mode_rate.chan_rate = chan_t_to_chan_rate(lchan_t);
 
 		if (activate == 2 || lchan->vamos.is_secondary) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25278
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I26813561ee9e7783a4004f32225f19296bd6319c
Gerrit-Change-Number: 25278
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210830/bd04c60f/attachment.htm>


More information about the gerrit-log mailing list