Introduce ipam plugin
This commit is contained in:
1 parent
c1d2c159f0
commit
ec3de1a072
5 files changed
+97
-12
No files matched your search
@@ -38,6 +38,11 @@ func (g *allocate) Try(alloc *Allocator) bool {
|
||||
alloc.establishRing()
|
||||
|
||||
if ok, addr := alloc.space.Allocate(g.r); ok {
|
||||
// If caller hasn't supplied a unique ID, file it under the IP address
|
||||
// which lets the caller then release the address using DELETE /ip/address
|
||||
if g.ident == "_" {
|
||||
g.ident = addr.String()
|
||||
}
|
||||
alloc.debugln("Allocated", addr, "for", g.ident, "in", g.r)
|
||||
alloc.addOwned(g.ident, addr)
|
||||
g.resultChan <- allocateResult{addr, nil}
|
||||
|
||||
Reference in new issue
Block a user