aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_subscriber.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-07-23 19:21:02 +0200
committerHarald Welte <laforge@gnumonks.org>2009-07-23 19:21:02 +0200
commit761e944182255225bd2d48caa7d66a28ec7dea65 (patch)
treecc2ed755d1957f1d296ae0940aeadaef612dc6a8 /openbsc/src/gsm_subscriber.c
parentb3c3faee940cda77afa9ba2500afa9ae9919851e (diff)
make sure subscr->net is always set
since a subscriber is an element of the gsm_network, we have to ensure subscr->net is always set correctly. We do this by using gsm_network as an argument to all functions that resolve or create a subscriber.
Diffstat (limited to 'openbsc/src/gsm_subscriber.c')
-rw-r--r--openbsc/src/gsm_subscriber.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c
index 56f15951..e8929062 100644
--- a/openbsc/src/gsm_subscriber.c
+++ b/openbsc/src/gsm_subscriber.c
@@ -126,7 +126,8 @@ static void subscr_free(struct gsm_subscriber *subscr)
talloc_free(subscr);
}
-struct gsm_subscriber *subscr_get_by_tmsi(const char *tmsi)
+struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net,
+ const char *tmsi)
{
struct gsm_subscriber *subscr;
@@ -136,10 +137,11 @@ struct gsm_subscriber *subscr_get_by_tmsi(const char *tmsi)
return subscr_get(subscr);
}
- return db_get_subscriber(GSM_SUBSCRIBER_TMSI, tmsi);
+ return db_get_subscriber(net, GSM_SUBSCRIBER_TMSI, tmsi);
}
-struct gsm_subscriber *subscr_get_by_imsi(const char *imsi)
+struct gsm_subscriber *subscr_get_by_imsi(struct gsm_network *net,
+ const char *imsi)
{
struct gsm_subscriber *subscr;
@@ -148,10 +150,11 @@ struct gsm_subscriber *subscr_get_by_imsi(const char *imsi)
return subscr_get(subscr);
}
- return db_get_subscriber(GSM_SUBSCRIBER_IMSI, imsi);
+ return db_get_subscriber(net, GSM_SUBSCRIBER_IMSI, imsi);
}
-struct gsm_subscriber *subscr_get_by_extension(const char *ext)
+struct gsm_subscriber *subscr_get_by_extension(struct gsm_network *net,
+ const char *ext)
{
struct gsm_subscriber *subscr;
@@ -160,7 +163,7 @@ struct gsm_subscriber *subscr_get_by_extension(const char *ext)
return subscr_get(subscr);
}
- return db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, ext);
+ return db_get_subscriber(net, GSM_SUBSCRIBER_EXTENSION, ext);
}
int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason)