aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/gprs_utils.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-02-21 00:39:36 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-03-15 19:18:14 +0100
commit10719b74c362591cd01c3766f74ef03639203e1d (patch)
tree4e0fed5a071f24099c9b565e11fe02f4af3f8774 /src/gprs/gprs_utils.c
parent5926e840ccdea595fb63e0a51e3069882e4ce73c (diff)
implement support for 3-digit MNC with leading zeros
Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout the code base to be able to handle an MNC < 100 that has three digits (leading zeros). Note that in gbproxy_test.ok, 0-0 changes to 000-000 instead of 000-00, because the parsed ra buffer is 000000 which results in 000-000, while 00f000 would result in 000-00. IOW this is expected. Change-Id: I7437dfaa586689e2bef0d4be6537e5577a8f6c26
Diffstat (limited to 'src/gprs/gprs_utils.c')
-rw-r--r--src/gprs/gprs_utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c
index 307699bed..d7cef1cce 100644
--- a/src/gprs/gprs_utils.c
+++ b/src/gprs/gprs_utils.c
@@ -239,8 +239,10 @@ void gprs_parse_tmsi(const uint8_t *value, uint32_t *tmsi)
}
int gprs_ra_id_equals(const struct gprs_ra_id *id1,
- const struct gprs_ra_id *id2)
+ const struct gprs_ra_id *id2)
{
- return (id1->mcc == id2->mcc && id1->mnc == id2->mnc &&
- id1->lac == id2->lac && id1->rac == id2->rac);
+ return (id1->mcc == id2->mcc
+ && !osmo_mnc_cmp(id1->mnc, id1->mnc_3_digits,
+ id2->mnc, id2->mnc_3_digits)
+ && id1->lac == id2->lac && id1->rac == id2->rac);
}