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

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


neels has uploaded this change for review. ( 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(-)



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

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210614/3a5f4893/attachment.htm>


More information about the gerrit-log mailing list