<feed xmlns='http://www.w3.org/2005/Atom'>
<title>accel-ppp.git/accel-pppd/extra/bitpool_test.c, branch master</title>
<subtitle>High performance PPTP/L2TP/SSTP/PPPoE/IPoE server for Linux (mirror of https://github.com/accel-ppp/accel-ppp.git)
</subtitle>
<id>https://git.amelek.net/accel-ppp/accel-ppp.git/atom?h=master</id>
<link rel='self' href='https://git.amelek.net/accel-ppp/accel-ppp.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/'/>
<updated>2026-06-03T11:57:45+00:00</updated>
<entry>
<title>ippool/ipv6pool: bitmap allocator + online reconfiguration</title>
<updated>2026-06-03T11:57:45+00:00</updated>
<author>
<name>Denys Fedoryshchenko</name>
<email>denys.f@collabora.com</email>
</author>
<published>2026-06-02T23:23:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=8afec90643a6e6d923032ae5c50d6c18e7a8b0c3'/>
<id>urn:sha1:8afec90643a6e6d923032ae5c50d6c18e7a8b0c3</id>
<content type='text'>
Replace the pre-generated free-list (one heap node per allocatable
address/prefix) with a per-pool bitmap. Each pool holds a list of
contiguous ranges, each range owning one bitmap (1 bit per unit);
a lease is a small per-session malloc wrapper around the ipdb item,
so pool memory is no longer shared or mutated by sessions.

Memory now scales with capacity at ~1 bit/unit instead of ~96B (v4) /
~128B (v6) per unit; startup, `show ippool`, and backup-restore are
O(1) instead of O(N)/O(N*M). Oversized IPv6 ranges (prefix_len-mask
&gt; 24) are rejected at parse time instead of OOMing in the malloc loop.

The ipdb_t vtable, the owner-based put dispatch, ipdb.h structs, and
struct ap_session are unchanged; RADIUS and chap-secrets backends are
untouched (reconcile filters by owner).

Preserved behavior: p2p/net30 allocators (via a step/gw_offset/
peer_offset geometry triple), shuffle (randomized scan start), named
pools, next-chains, gw-ip-address, RADIUS pool-name attrs, and the
USE_BACKUP save/restore path. `gw=` is now accepted-and-ignored (its
per-address local gateway was already overridden at allocation time).

New: online reconfiguration. An EV_CONFIG_RELOAD handler rebuilds the
pool set and reconciles live sessions (sessions are the source of
truth, the bitmap is rebuilt from them) under
pool_set_rwlock(write) -&gt; ses_lock(read) -&gt; per-pool spinlock.
Sessions whose address left the pools are handled per a new
`reload-orphan = keep|disconnect` knob (default keep); foreign
in-range addresses are reserved to avoid duplicate assignment.

Adds extra/bitpool.h (shared bit-array helpers) and a standalone
extra/bitpool_test.c (not wired into cmake) covering the bitmap and
the v4/v6 address&lt;-&gt;bit math, cross-checked against an __int128
reference.

Signed-off-by: Denys Fedoryshchenko &lt;denys.f@collabora.com&gt;

</content>
</entry>
</feed>
