[db] Keep track of the current gsm_network
diff --git a/include/openbsc/db.h b/include/openbsc/db.h
index 61a3ac4..2036832 100644
--- a/include/openbsc/db.h
+++ b/include/openbsc/db.h
@@ -26,7 +26,7 @@
 #include <openbsc/gsm_subscriber.h>
 
 /* one time initialisation */
-int db_init(const char *name);
+int db_init(const char *name, struct gsm_network *network);
 int db_prepare();
 int db_fini();
 
diff --git a/src/bsc_hack.c b/src/bsc_hack.c
index 3fbc7f6..8bc1c6b 100644
--- a/src/bsc_hack.c
+++ b/src/bsc_hack.c
@@ -916,7 +916,7 @@
 	paging_init(bts);
 	bts->paging.channel_allocated = bsc_hack_channel_allocated;
 
-	if (db_init(database_name)) {
+	if (db_init(database_name, gsmnet)) {
 		printf("DB: Failed to init database. Please check the option settings.\n");
 		return -1;
 	}	 
diff --git a/src/db.c b/src/db.c
index a761364..9c4c378 100644
--- a/src/db.c
+++ b/src/db.c
@@ -32,6 +32,7 @@
 static char *db_basename = NULL;
 static char *db_dirname = NULL;
 dbi_conn conn;
+static struct gsm_network *current_network = NULL;
 
 static char *create_stmts[] = {
 	"CREATE TABLE IF NOT EXISTS Meta ("
@@ -86,7 +87,7 @@
 	printf("DBI: %s\n", msg);
 }
 
-int db_init(const char *name) {
+int db_init(const char *name, struct gsm_network *network) {
 	dbi_initialize(NULL);
 	conn = dbi_conn_new("sqlite3");
 	if (conn==NULL) {
@@ -117,6 +118,7 @@
 		return 1;
 	}
 
+	current_network = network;
 	return 0;
 }
 
diff --git a/tests/db/db_test.c b/tests/db/db_test.c
index 2ccf243..93bf152 100644
--- a/tests/db/db_test.c
+++ b/tests/db/db_test.c
@@ -50,7 +50,7 @@
 
 int main() {
 
-	if (db_init("hlr.sqlite3")) {
+	if (db_init("hlr.sqlite3", NULL)) {
 		printf("DB: Failed to init database. Please check the option settings.\n");
 		return 1;
 	}