Possible bug in "gsm48_decode_lai" code

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/baseband-devel@lists.osmocom.org/.

Sylvain Munaut 246tnt at gmail.com
Sun Dec 2 08:57:04 UTC 2012


On Sun, Dec 2, 2012 at 7:49 AM, Bhaskar11 <niceguy108 at gmail.com> wrote:
> While running Cell-Log application, I found that the main branch of
> OsmocomBB gives wrong value of MCC/MNC in hex (but correct one in decimal),
> but the Sylvain testing branch gives correct value.

Your branches are not up to date ... testing has only two commits
added to it and they have nothing to do with gsm48_decode_lai.
So please update and re-test.



Now when looking at the history of this function, it looks very weird to me :

You find:

----
commit a8ce4ea4696a385d18beb785eef8f510c6fed143
Author: Harald Welte <laforge at gnumonks.org>
Date:   Sat Sep 8 22:43:50 2012 +0200

    layer23: gsm48_decode_lai() is now in libosmogsm
----

followed by:

----
commit 07f83456460a2cdb8d288ac647f04a5bc09dc1cf
Author: Andreas Eversberg <jolly at eversberg.eu>
Date:   Tue Oct 30 10:26:20 2012 +0100

    Fixed decoding of hexadecimal LAI components

    libosmocore has changed its LAI decoding from hex to decimal. This caused
    wrong decoding of MCC and MNC. In order to provide required hex
    transcoding, special hex encoding and decoding function are added to
    mobile/sysinfo.c.
----

and in libosmocore:

---
commit 774a9de8b36a53c9e4e4dca4efbb9944cd39ff65
Author: Harald Welte <laforge at gnumonks.org>
Date:   Fri Jul 13 21:35:13 2012 +0200

    import gsm48_decode_lai() function from osmocom-bb/mobile sysinfo.c

commit a9250b9ebcdab7134e5d062e8ca37f9532eca5e8
Author: Harald Welte <laforge at gnumonks.org>
Date:   Fri Jul 13 22:57:31 2012 +0200

    gsm48_decode_lai(): return real integers for mcc/mnc, not hex!

    This is to make it orthogonal with gsm48_encode_lai()
---


Now ... this look a little bit like a SNAFU. Now if the goal was to
put common code in libosmocore, that didn't quite endup like that
because now osmocom-bb has a gsm48_decode_lai_hex function that does
the exact same thing as the previous gsm48_decode_lai function and it
doesn't use the libosmocore gsm48_decode_lai function at all. And
having those two different interface looks silly to me ...  So which
one is the more practical ?


Cheers,

     Sylvain




More information about the baseband-devel mailing list