From 516917e83645fad3b72623817c01190cc773e0e6 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 29 Apr 2010 20:46:11 +0200 Subject: Fixes and improvements of layer23. --- src/shared/libosmocore/src/gsm48.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/shared/libosmocore') diff --git a/src/shared/libosmocore/src/gsm48.c b/src/shared/libosmocore/src/gsm48.c index bc59397c..6a7c39e0 100644 --- a/src/shared/libosmocore/src/gsm48.c +++ b/src/shared/libosmocore/src/gsm48.c @@ -272,13 +272,13 @@ void gsm48_generate_lai(struct gsm48_loc_area_id *lai48, uint16_t mcc, to_bcd(bcd, mnc); /* FIXME: do we need three-digit MNC? See Table 10.5.3 */ -#if 0 - lai48->digits[1] |= bcd[2] << 4; - lai48->digits[2] = bcd[0] | (bcd[1] << 4); -#else - lai48->digits[1] |= 0xf << 4; - lai48->digits[2] = bcd[1] | (bcd[2] << 4); -#endif + if (mnc > 99) { + lai48->digits[1] |= bcd[2] << 4; + lai48->digits[2] = bcd[0] | (bcd[1] << 4); + } else { + lai48->digits[1] |= 0xf << 4; + lai48->digits[2] = bcd[1] | (bcd[2] << 4); + } lai48->lac = htons(lac); } -- cgit v1.2.3