Change in osmo-bsc[master]: vty: reassign: add missing check for valid target lchan

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/.

neels gerrit-no-reply at lists.osmocom.org
Mon Jun 14 22:44:08 UTC 2021


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24664 )

Change subject: vty: reassign: add missing check for valid target lchan
......................................................................

vty: reassign: add missing check for valid target lchan

Make sure that the target lchan has been initialized before attempting
to reassign.

I ran into this in the VAMOS tests, forgetting to set the BTS_FEAT_VAMOS
in osmo-bts-omldummy: the vty command from ttcn attempts to reassign to
a non-initialized lchan, and aborts osmo-bsc.

Change-Id: Ia77a3312dde0e4b8df9ad2f33339266bae06439d
---
M src/osmo-bsc/bsc_vty.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  neels: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 430863b..880bd94 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -6657,6 +6657,10 @@
 		vty_out(vty, "cannot re-assign, source lchan is not in ESTABLISHED state%s", VTY_NEWLINE);
 		return CMD_WARNING;
 	}
+	if (!to_lchan->fi) {
+		vty_out(vty, "cannot re-assign, target lchan is not initialized%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
 	if (!lchan_state_is(to_lchan, LCHAN_ST_UNUSED)) {
 		vty_out(vty, "cannot re-assign, target lchan is already in use%s", VTY_NEWLINE);
 		return CMD_WARNING;

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia77a3312dde0e4b8df9ad2f33339266bae06439d
Gerrit-Change-Number: 24664
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210614/3d96bce4/attachment.htm>


More information about the gerrit-log mailing list