IP allocator to take firstIP and lastIP instead of CIDR block
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 875
- PR merge metrics
- No merged PRs in 30d
Description
(Related to https://github.com/docker/docker/issues/15287)
It would be more flexible if the IP allocator could be instructed to use an arbitrary range of addresses, e.g. 10.10.0.100 - 10.10.0.199, rather than be restricted to a block on a CIDR boundary.
In fact, the allocator already works this way internally: newAllocatedMap explodes the passed CIDR range into firstIP and lastIP.
Therefore I think it would be pretty simple for newAllocatedMap to change it to take firstIP and lastIP as arguments instead; with a similar change to RegisterSubnet to become RegisterRange.
RegisterSubnet can then become a wrapper which calls RegisterRange, as a transition measure and/or as an alternate API for callers who have a CIDR block and don't want to calculate firstIP and lastIP themselves.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating newAllocatedMap and RegisterSubnet in the Go source and trace how the allocator derives firstIP and lastIP from a CIDR range. Confirm the existing allocation behavior, then define the RegisterRange path for explicit bounds while keeping RegisterSubnet as a CIDR-based wrapper. Done means arbitrary ranges work without breaking existing callers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100