On 17 Nov 2015, at 14:38, Neels Hofmeyr
<nhofmeyr(a)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