From 33f2c4d898c59a05c8122fd9897cbd22f643b367 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 7 Nov 2014 09:54:57 +0100 Subject: bts: Fail OML in case the channel combination is wrong In case a BTS is being bootstrapped and one TS can not be activated prevent the whole BTS from coming up. When the OML activation is not being done the rest of the BSC code still assumes these logical channel(s) to be available and one will see channel activation issues that might be hard to debug. Instead of having a half-configured system up and running, keep the BTS offline. --- openbsc/src/libbsc/bts_ipaccess_nanobts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index fc7bf2897..9fa03bfe6 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -38,6 +38,7 @@ #include #include #include +#include extern struct gsm_network *bsc_gsmnet; @@ -354,7 +355,10 @@ static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd) new_state->availability == NM_AVSTATE_DEPENDENCY) { enum abis_nm_chan_comb ccomb = abis_nm_chcomb4pchan(ts->pchan); - abis_nm_set_channel_attr(ts, ccomb); + if (abis_nm_set_channel_attr(ts, ccomb) == -EINVAL) { + ipaccess_drop_oml(trx->bts); + return -1; + } abis_nm_chg_adm_state(trx->bts, obj_class, trx->bts->bts_nr, trx->nr, ts->nr, NM_STATE_UNLOCKED); -- cgit v1.2.3