diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-16 00:50:06 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-20 00:21:42 +0000 |
commit | 14477997c1539878b877396ef5b4251001f4e70f (patch) | |
tree | fdf3bae0dc46585cec0c21cc9f7aba9967d18bd1 | |
parent | 1c260c0a09810c76188e3d39454c309ffbc72f6b (diff) |
osmo-auc-gen: fix --sqn limit on 32bit systems, fixing build
osmo-auc-gen on 32bit systems allowed only --sqn up to 32bits width. However,
the recently added regression test for osmo-auc-gen includes an ivocation with
a 48bit wide --sqn, which now causes the builds to fail on 32bit systems.
Fix the --sqn argument parsing for larger integers by using strtoull(). Do away
with the intermediate variable 'ul' and place the value directly in the auth
data struct.
Change-Id: Ifb73b3b3de06576e36076ca573d52327f90a1f77
-rw-r--r-- | utils/osmo-auc-gen.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 4e2456a7..6b1e6239 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -106,7 +106,6 @@ int main(int argc, char **argv) while (1) { int c; - unsigned long ul; static struct option long_options[] = { { "2g", 0, 0, '2' }, { "3g", 0, 0, '3' }, @@ -196,8 +195,7 @@ int main(int argc, char **argv) fprintf(stderr, "Only UMTS has SQN\n"); exit(2); } - ul = strtoul(optarg, 0, 10); - test_aud.u.umts.sqn = ul; + test_aud.u.umts.sqn = strtoull(optarg, 0, 10); /* Before calculating the UMTS auth vector, * osmo_auth_gen_vec() increments the SQN. SQN-1 here * to end up with the SQN the user requested. */ |