From c9763a3de45fc70a889298494a68bd5526d0ee82 Mon Sep 17 00:00:00 2001 From: Kevin Redon Date: Mon, 4 Nov 2013 22:43:15 +0100 Subject: [PATCH] db: Fetch the authorized key using ulonglong Location Update Requests time out and get rejected because the subscriber is not authorized. Authorizing the subscriber through openBSC or sqlite3 doesn't help the subscriber is still seen and shown as not authorized The value is read as uint, this is the wrong type it's a (u)longlong in libdbi 0.9.0 and later. --- openbsc/src/libmsc/db.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index d179c4e23..a842353e0 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -633,14 +633,15 @@ static void db_set_from_query(struct gsm_subscriber *subscr, dbi_conn result) if (string) strncpy(subscr->extension, string, GSM_EXTENSION_LENGTH); - subscr->lac = dbi_result_get_uint(result, "lac"); + subscr->lac = dbi_result_get_ulonglong(result, "lac"); if (!dbi_result_field_is_null(result, "expire_lu")) subscr->expire_lu = dbi_result_get_datetime(result, "expire_lu"); else subscr->expire_lu = GSM_SUBSCRIBER_NO_EXPIRATION; - subscr->authorized = dbi_result_get_uint(result, "authorized"); + subscr->authorized = dbi_result_get_ulonglong(result, "authorized"); + } #define BASE_QUERY "SELECT * FROM Subscriber "