[PATCH 3/3] gtphub: nr_map: add min,max and wrap.

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 20:05:40 UTC 2015


> On 17 Nov 2015, at 14:38, Neels Hofmeyr <nhofmeyr at sysmocom.de> wrote:
> 
> 
> +	/* The TEI numbers will simply wrap and be reused, which will work out
> +	 * in practice. Problems would arise if one given peer maintained the
> +	 * same TEI for a time long enough for the TEI nr map to wrap an entire
> +	 * uint32_t; if a new TEI were mapped every second, this would take
> +	 * more than 100 years (in which a single given TEI must not time out)
> +	 * to cause a problem. */

Unless performance matters I am not for probalistic correct, specially not in the
beginning of a new piece of software. "Modern" smartphones will open a PDP
context very early and they live for a potentially long time (until you reboot your
phone or such).

So I would prefer to check if a TEI is used (at least the number should be random)
before using it. So even if the assignment is not random right now I would still
prefer the check if it is assigned or not.

E.g. a unit test that exhausts the entire number space should be feasible.

holger





More information about the OpenBSC mailing list