From 1ee089f37a6c7be98c92cb4f37675eeb1a4444aa Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Wed, 6 Jan 2016 18:07:02 +0100 Subject: hnbgw: When a HNB is released release associated UEs as well --- src/hnbgw.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hnbgw.c b/src/hnbgw.c index e7dff3f..3cba131 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -102,6 +102,16 @@ struct ue_context *ue_context_by_imsi(struct hnb_gw *gw, const char *imsi) return NULL; } +void ue_context_free_by_hnb(struct hnb_gw *gw, const struct hnb_context *hnb) +{ + struct ue_context *ue, *tmp; + + llist_for_each_entry_safe(ue, tmp, &gw->ue_list, list) { + if (ue->hnb == hnb) + ue_context_free(ue); + } +} + static uint32_t get_next_ue_ctx_id(struct hnb_gw *gw) { uint32_t id; @@ -249,6 +259,7 @@ void hnb_context_release(struct hnb_context *ctx) llist_del(&map->hnb_list); context_map_deactivate(map); } + ue_context_free_by_hnb(ctx->gw, ctx); osmo_stream_srv_destroy(ctx->conn); talloc_free(ctx); -- cgit v1.2.3