aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/gtphub
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-11-17 14:24:46 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-03 11:39:24 +0100
commit334af5dd9dcee962a25ca9cca9425da5d7f57a2c (patch)
tree3d87221a189de2c19e3883303faa8428fea812e3 /openbsc/tests/gtphub
parent5e95a411946ba3c520f048c07f8fdc3dff26d564 (diff)
gtphub: fix number map range for TEIs.
Use unsigned int for nr_map, just large enough to fit the TEI space. Adjust log output formats and casts accordingly. Fixes: TEIs are uint32_t, but the nr_map so far used int. This would cause TEIs from 0x80000000 on to be handled and printed as a negative value. Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/tests/gtphub')
-rw-r--r--openbsc/tests/gtphub/gtphub_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/tests/gtphub/gtphub_test.c b/openbsc/tests/gtphub/gtphub_test.c
index 12c9d7825..2fa28c2ff 100644
--- a/openbsc/tests/gtphub/gtphub_test.c
+++ b/openbsc/tests/gtphub/gtphub_test.c
@@ -233,9 +233,9 @@ static int nr_map_is(struct nr_map *map, const char *str)
size_t len = sizeof(buf);
struct nr_mapping *m;
llist_for_each_entry(m, &map->mappings, entry) {
- size_t wrote = snprintf(pos, len, "(%d->%d@%d), ",
- (int)m->orig,
- (int)m->repl,
+ size_t wrote = snprintf(pos, len, "(%u->%u@%d), ",
+ m->orig,
+ m->repl,
(int)m->expiry_entry.expiry);
OSMO_ASSERT(wrote < len);
pos += wrote;