From 89a4f1cb46b13297c151e71f4d4d398d94cee62c Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Tue, 16 Jun 2015 10:30:30 +0000
Subject: [PATCH] fix a bug with computation of sqn ("sqn[2] << 24" in an "int"
 in C; when implicitely casting to uint64_t the 31st bit is duplicated to the
 higher 32 bits; conclusion is easy)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7568 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair-cn/OPENAIRHSS/db/db_connector.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openair-cn/OPENAIRHSS/db/db_connector.c b/openair-cn/OPENAIRHSS/db/db_connector.c
index 6585036b040..f96032896ac 100644
--- a/openair-cn/OPENAIRHSS/db/db_connector.c
+++ b/openair-cn/OPENAIRHSS/db/db_connector.c
@@ -394,7 +394,8 @@ int hss_mysql_push_rand_sqn(const char *imsi, uint8_t *rand_p, uint8_t *sqn)
   }
 
   sqn_decimal = ((uint64_t)sqn[0] << 40) | ((uint64_t)sqn[1] << 32) |
-                (sqn[2] << 24) | (sqn[3] << 16) | (sqn[4] << 8) | sqn[5];
+                ((uint64_t)sqn[2] << 24) | (sqn[3] << 16) |
+                (sqn[4] << 8) | sqn[5];
 
   query_length = sprintf(query, "UPDATE `users` SET `rand`=UNHEX('");
 
-- 
GitLab