aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-22 17:46:47 +0100
committerHarald Welte <laforge@gnumonks.org>2016-02-15 14:23:18 +0100
commitb1d2dd316ff606cb94515dd55fea896237e5ef74 (patch)
tree1192d5445103bae770f66492719a2dd0cb96bf5f /src
parentf5b42c34219ef8d01987b4d811be3bc8035e337d (diff)
abis.c: Fix segfault on OML link loss
When the OML signalling link is lost, first set bts->oml_link = NULL, then iterate over the RSL links and close them. Closing the RSL link will cause a OML state change message to be sent, which in turn tries to use the no-longer-existing OML link. The code should be cleaned up further to distinguish which signalling link was lost, and actually communicate a RSL(only) loss to OML. But for now, it's best to simply close down all links and terminate osmo-bts to ensure all state is properly reset and recovered.
Diffstat (limited to 'src')
-rw-r--r--src/common/abis.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/abis.c b/src/common/abis.c
index f0c9fc4d..defdb443 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -134,6 +134,12 @@ static void sign_link_down(struct e1inp_line *line)
struct gsm_bts_trx *trx;
LOGP(DABIS, LOGL_ERROR, "Signalling link down\n");
+ /* First remove the OML signalling link */
+ if (g_bts->oml_link)
+ e1inp_sign_link_destroy(g_bts->oml_link);
+ g_bts->oml_link = NULL;
+
+ /* Then iterate over the RSL signalling links */
llist_for_each_entry(trx, &g_bts->trx_list, list) {
if (trx->rsl_link) {
e1inp_sign_link_destroy(trx->rsl_link);
@@ -142,10 +148,6 @@ static void sign_link_down(struct e1inp_line *line)
}
}
- if (g_bts->oml_link)
- e1inp_sign_link_destroy(g_bts->oml_link);
- g_bts->oml_link = NULL;
-
bts_model_abis_close(g_bts);
}