auth: Fix AuthTupe re-use condition
It's not the key_seq of the last authtuple we must check, but
the one sent by the MS.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
diff --git a/openbsc/src/auth.c b/openbsc/src/auth.c
index 9103901..ee1e291 100644
--- a/openbsc/src/auth.c
+++ b/openbsc/src/auth.c
@@ -87,7 +87,7 @@
/* If possible, re-use the last tuple and skip auth */
rc = db_get_lastauthtuple_for_subscr(atuple, subscr);
if ((rc == 0) &&
- (atuple->key_seq != GSM_KEY_SEQ_INVAL) &&
+ (key_seq != GSM_KEY_SEQ_INVAL) &&
(atuple->use_count < 3))
{
atuple->use_count++;