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.
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index d179c4e..a842353 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -633,14 +633,15 @@
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 "