path: root/src/libbsc/bsc_subscriber.c
diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2018-01-09 23:48:25 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-12 05:26:30 +0100
commit090dd141cb88607213068853592594ce2c6f8e1a (patch)
treec18dc54a137d46946b0738b81825990c83a8fd06 /src/libbsc/bsc_subscriber.c
parenta642c872e4c05dc3d20a72a9f2656ba1b09a0ade (diff)
associate conn with bsc subscriber where possible (TODO)neels/ho_with_on_change_cb
Various logging in the code (e.g. handover) attempts to log the subscriber information from conn->bsub, but so far, the only time we set conn->bsub is during paging. We do though get IMSI and/or TMSI information from Layer 3 Complete messaging, not only from the Paging Request, which is already used for IMSI filtering. Also extract TMSI and create a conn->bsub subscriber. <-- TODO Make sure conn->bsub also gets cleaned up by bsc_subscr_put() when the conn is freed. Change-Id: Icc20c141ec339385181949b93548a73121bb7615
Diffstat (limited to 'src/libbsc/bsc_subscriber.c')
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c
index d9d90baa9..65a660b40 100644
--- a/src/libbsc/bsc_subscriber.c
+++ b/src/libbsc/bsc_subscriber.c
@@ -41,7 +41,6 @@ static struct bsc_subscr *bsc_subscr_alloc(struct llist_head *list)
return NULL;
llist_add_tail(&bsub->entry, list);
- bsub->use_count = 1;
return bsub;
@@ -92,7 +91,7 @@ struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list,
return bsub;
bsub = bsc_subscr_alloc(list);
bsc_subscr_set_imsi(bsub, imsi);
- return bsub;
+ return bsc_subscr_get(bsub);
struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
@@ -104,7 +103,7 @@ struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
return bsub;
bsub = bsc_subscr_alloc(list);
bsub->tmsi = tmsi;
- return bsub;
+ return bsc_subscr_get(bsub);
const char *bsc_subscr_name(struct bsc_subscr *bsub)