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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Aug 31 08:14:46 UTC 2021


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

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 5ce1d69..17fdb45 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -1588,47 +1588,25 @@
 		/* 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) {

-- 
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: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210831/9508d00e/attachment.htm>


More information about the gerrit-log mailing list