From 293076d9d1fa445007d823db41ded852b7f629d1 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 15 Jun 2021 00:02:03 +0200 Subject: 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 --- src/osmo-bsc/bsc_vty.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 430863bc5..880bd9403 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -6657,6 +6657,10 @@ DEFUN(lchan_reassign, lchan_reassign_cmd, 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; -- cgit v1.2.3