diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-15 00:02:03 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-15 00:31:25 +0200 |
commit | 293076d9d1fa445007d823db41ded852b7f629d1 (patch) | |
tree | 130178dc8891067f28c87d1c2eeb32ccedf15064 | |
parent | 519294d563ed07a2cc5ddf0c6b0c38fcc23e74f7 (diff) |
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
-rw-r--r-- | src/osmo-bsc/bsc_vty.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |