Skip to content

Resolve "total-nas counter overrun (uint128 needed)"

Closes #2658 (closed).

  • cc426eb6 add support for big ints

  • 66ab9279 add unit tests for big ints

  • 9fc7c02f add BigIntElement

    BigIntElement is modelled as an int128_t, following the precedent of signed integer of int64_t from IntElement.

  • f5aa07c1 add big integer support to statistics

    Pool capacities have been promoted in code from uint64_t to uint128_t.

    Bigint is modelled as an int128_t in statistics, following the precedent of signed integer of int64_t from statistics.

    • "total-nas" is extended to 128 bits as requested in the issue.
    • "total-pds" has the same risk of overflowing so it has been extended as well.
    • "total-addresses" always fits in 64 bits, but certain code forces a 128 bit value on it. See Pool::getCapacity(), Subnet::getPoolCapacity(), Subnet::sumPoolCapacity(). It could have been truncated to a 64 bit value, but that seems like an unnecessary complication.

    Because of the disparity in signedness there is some truncation that can happen when pool capacity values are passed on to statistics. That only happens for the last half of the value range, so for prefix ranges larger than /1.

  • 0b76e67c document big integer statistics

  • 52fa8963 add ChangeLog entry

Edited by Andrei Pavel

Merge request reports