Make the network and broadcast address reservation optional and editable - #199
Make the network and broadcast address reservation optional and editable#199GeertJohan wants to merge 2 commits into
Conversation
928e1f9 to
5740b61
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #199 +/- ##
==========================================
+ Coverage 33.46% 33.73% +0.27%
==========================================
Files 17 17
Lines 3156 3338 +182
==========================================
+ Hits 1056 1126 +70
- Misses 1878 1978 +100
- Partials 222 234 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
GRPC Service needs this option to be exposed as well |
cdfa0aa to
4dac07b
Compare
cb395ad to
d33321e
Compare
Every prefix reserves its network and (IPv4) broadcast address at creation (the FIXME in newPrefix). For prefixes used as routed pools, where no L2 semantics apply, this wastes addresses: a /30 yields 2 usable instead of 4. - NewPrefix accepts options; WithNetworkAndBroadcastAllocatable() creates a prefix whose network and broadcast address are allocatable like any other address. - Ipamer.SetPrefixNetworkAndBroadcastAllocatable edits the flag on an existing prefix: making the addresses allocatable is always possible, reserving them again fails while either address is allocated. - The flag persists through all storages (prefixJSON) and gob; data from before this field decodes to the previous behavior (reserved). - hasIPs() and the child prefix release check account for the flag, so a prefix with allocatable boundary addresses cannot be deleted while it holds a single allocation. The child release check previously allowed up to 2 ips regardless of address family; it now uses hasIPs(). - grpc: network_and_broadcast_allocatable on Prefix and CreatePrefixRequest, a new SetPrefixNetworkAndBroadcastAllocatable rpc, and the cli flag --network-and-broadcast-allocatable. The proto3 zero values match the previous behavior, so existing clients and servers are unaffected.
d33321e to
996e681
Compare
|
Changed the naming, I think it's more friendly to read / self-documenting now. |
|
And implemented gRPC :) |
|
/ok-to-build |
|
Usage reporting needs also adoption |
Reserved network and broadcast addresses no longer count as acquired ips; they reduce the available count instead. A reserved /29 reports 6 available and 0 acquired at creation; with the addresses allocatable it reports 8 available. The free count (available minus acquired) is unchanged in both modes.
|
@majst01 Added this. Note that the diff changes the meaning of |
|
/ok-to-build |
Every prefix reserves its network and (IPv4) broadcast address at creation (the FIXME in newPrefix). For prefixes used as routed pools, where no L2 semantics apply, this wastes addresses: a /30 yields 2 usable instead of 4.
Used AI-Tools ✨
Noteworthy