summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_init.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-10-05 15:48:54 +0200
committerHarald Welte <laforge@gnumonks.org>2012-10-08 21:17:51 +0200
commitd9173c3fce9b3bf1157b2585d7b89364aa26cb18 (patch)
treebd620820e6352d7c6c5d835253ddda528ab66a68 /openbsc/src/libbsc/bsc_init.c
parent8936d005873acecb59737594566cc3ddf6db5677 (diff)
bsc_init: Don't drop all BTSs because a single BTS had an error
Diffstat (limited to 'openbsc/src/libbsc/bsc_init.c')
-rw-r--r--openbsc/src/libbsc/bsc_init.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 153355d61..a19179d66 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -43,7 +43,7 @@ extern int hsl_setup(struct gsm_network *gsmnet);
/* Callback function for NACK on the OML NM */
static int oml_msg_nack(struct nm_nack_signal_data *nack)
{
- int i;
+ struct gsm_bts *bts;
if (nack->mt == NM_MT_SET_BTS_ATTR_NACK) {
@@ -58,11 +58,13 @@ static int oml_msg_nack(struct nm_nack_signal_data *nack)
return 0;
drop_bts:
- for (i = 0; i < bsc_gsmnet->num_bts; ++i) {
- struct gsm_bts *bts = gsm_bts_num(bsc_gsmnet, i);
- if (is_ipaccess_bts(bts))
- ipaccess_drop_oml(bts);
- }
+ if (!nack->msg || !nack->msg->trx)
+ return 0;
+
+ bts = nack->msg->trx->bts;
+
+ if (is_ipaccess_bts(bts))
+ ipaccess_drop_oml(bts);
return 0;
}