Files
ModemManager/src
Aleksander Morgado e7881e4e29 broadband-bearer: prefer unused CID to overwriting an existing one
There are two places where we look for unused CIDs:

 * First, while processing the list of existing contexts returned by
   CGDCONT?, we look for gaps in the used CIDs. E.g. if the first
   context has CID=1 and the next one has CID=3, we can definitely use
   the unused CID=2.

 * Then, while processing the response of CGDCONT=?, we try to see
   whether there is any empty CID available after the last existing
   one found. E.g. if the last existing context has CID=3 and the
   format tells us that the max allowed CID is 16, we can definitely
   use the unused CID=4.

In both these cases, we should prefer using such an unused CID found
to overwriting other CIDs that are already defined.

This logic will now overwrite existing CIDs only if there are no
unused CIDs, and the preference to overwrite is as follows:

 * If there is any existing context defined without an explicit APN,
   overwrite it.

 * Otherwise, overwrite the last existing CID found.

 * And in the worst case, when no list of contexts was loaded
   properly (e.g. some Android phones don't allow querying), fallback
   to overwriting CID=1.
2019-09-13 18:13:26 +00:00
..
2018-01-25 09:52:12 +01:00
2017-07-17 13:46:14 -05:00
2017-06-21 13:08:17 +02:00
2018-01-25 09:52:12 +01:00