[PATCH 2/3] gtphub: fix number map range for TEIs.

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/OpenBSC@lists.osmocom.org/.

Holger Freyther holger at freyther.de
Wed Nov 25 19:53:45 UTC 2015


> On 17 Nov 2015, at 14:38, Neels Hofmeyr <nhofmeyr at sysmocom.de> wrote:
> 
> 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.


good!


> -typedef int nr_t;
> +typedef unsigned int nr_t;

use uint32_t here then? and "nr_t" is that clear it refers to a tei?


> +	    (unsigned int)nrm->orig, (unsigned int)nrm->repl);

What is the explicit casting about?

holger


More information about the OpenBSC mailing list