summaryrefslogtreecommitdiffstats
path: root/src/shared/libosmocore
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2010-04-29 20:46:11 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2010-04-29 20:46:11 +0200
commit516917e83645fad3b72623817c01190cc773e0e6 (patch)
treea3391e353870f55af763289b750baf0be7442e29 /src/shared/libosmocore
parent9ef7ac8b118f20eddd811561a4fb3ca4e9f2e054 (diff)
Fixes and improvements of layer23.
Diffstat (limited to 'src/shared/libosmocore')
-rw-r--r--src/shared/libosmocore/src/gsm48.c14
1 files changed, 7 insertions, 7 deletions
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);
}