From b7c19ed2b042645ddbf95d023f8255284f6a369f Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 23 Jun 2020 16:49:08 +0200 Subject: vty: check with is_ipaccess_bts() before using IPACC The IPACC protocol is an extension to the conventional RSL protocol to negotiate ip address and port for RTP/VoIP. This protocol is BTS specific (sysmobts, ip-access nanobts) and not used with E1 BTSs The bsc VTY is able to trigger certain IPACC functions for debug purposes. Some of those commands do not check if the BTS is really of type IP-access before trying to send an IPACC command. Let's add checks to prevent IPACC messages to be sent to E1 or otherwise incompatible BTSs models. Change-Id: I9ee78b6b1d342abaccc09a87dee6af79e76e5468 Related: OS#2547 --- src/osmo-bsc/bsc_vty.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index f46a84ca5..36b16a21e 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -5045,7 +5045,8 @@ DEFUN(lchan_act, lchan_act_cmd, } vty_out(vty, "%% activating lchan %s%s", gsm_lchan_name(lchan), VTY_NEWLINE); rsl_tx_chan_activ(lchan, RSL_ACT_TYPE_INITIAL, 0); - rsl_tx_ipacc_crcx(lchan); + if (is_ipaccess_bts(lchan->ts->trx->bts)) + rsl_tx_ipacc_crcx(lchan); } else { if (!lchan->fi) { vty_out(vty, "%% Cannot release: Channel not initialized%s", VTY_NEWLINE); @@ -5124,6 +5125,11 @@ DEFUN(lchan_mdcx, lchan_mdcx_cmd, lchan = &ts->lchan[ss_nr]; + if (!is_ipaccess_bts(lchan->ts->trx->bts)) { + vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); + return CMD_WARNING; + } + if (ss_nr >= pchan_subslots(ts->pchan_is)) { vty_out(vty, "%% subslot index %d too large for physical channel %s (%u slots)%s", ss_nr, gsm_pchan_name(ts->pchan_is), pchan_subslots(ts->pchan_is), -- cgit v1.2.3