aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bts_ipaccess_nanobts.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libbsc/bts_ipaccess_nanobts.c')
-rw-r--r--openbsc/src/libbsc/bts_ipaccess_nanobts.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
index 825a22e2a..9e1b3c2cb 100644
--- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c
+++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
@@ -551,6 +551,7 @@ void ipaccess_drop_rsl(struct gsm_bts_trx *trx)
void ipaccess_drop_oml(struct gsm_bts *bts)
{
+ struct gsm_bts *rdep_bts;
struct gsm_bts_trx *trx;
if (!bts->oml_link)
@@ -564,6 +565,21 @@ void ipaccess_drop_oml(struct gsm_bts *bts)
ipaccess_drop_rsl(trx);
bts->ip_access.flags = 0;
+
+ /*
+ * Go through the list and see if we are the depndency of a BTS
+ * and then drop the BTS. This can lead to some recursion but it
+ * should be fine in userspace.
+ * The oml_link is serving as recursion anchor for us and
+ * it is set to NULL some lines above.
+ */
+ llist_for_each_entry(rdep_bts, &bts->network->bts_list, list) {
+ if (!bts_depend_is_depedency(rdep_bts, bts))
+ continue;
+ LOGP(DLINP, LOGL_NOTICE, "Dropping BTS(%u) due BTS(%u).\n",
+ rdep_bts->nr, bts->nr);
+ ipaccess_drop_oml(rdep_bts);
+ }
}
/* This function is called once the OML/RSL link becomes up. */