aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-01-06 18:07:02 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2016-01-07 11:01:15 +0100
commit1ee089f37a6c7be98c92cb4f37675eeb1a4444aa (patch)
treedfe0b513f9cc4b8a885844e528154c6434c22ad2
parent6480cadd8e6e9144c417f6600a31eeab36bfae0b (diff)
hnbgw: When a HNB is released release associated UEs as well
-rw-r--r--src/hnbgw.c11
1 files changed, 11 insertions, 0 deletions
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);