diff --git a/ipam/allocator.go b/ipam/allocator.go index 831b9862..6dbd7f37 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -275,7 +275,7 @@ func (alloc *Allocator) spaceRequestDenied(sender mesh.PeerName, r address.Range for i := 0; i < len(alloc.pendingClaims); { claim := alloc.pendingClaims[i].(*claim) if r.Contains(claim.cidr.Addr) { - claim.deniedBy(alloc, sender) + claim.deniedBy(alloc, sender, nil) alloc.pendingClaims = append(alloc.pendingClaims[:i], alloc.pendingClaims[i+1:]...) continue } diff --git a/ipam/claim.go b/ipam/claim.go index 02ba251e..153eb7d1 100644 --- a/ipam/claim.go +++ b/ipam/claim.go @@ -135,12 +135,16 @@ func (c *claim) Try(alloc *Allocator) bool { return true } -func (c *claim) deniedBy(alloc *Allocator, owner mesh.PeerName) { +func (c *claim) deniedBy(alloc *Allocator, owner mesh.PeerName, err error) { name, found := alloc.nicknames[owner] if found { name = " (" + name + ")" } - c.sendResult(fmt.Errorf("address %s is owned by other peer %s%s", c.cidr.String(), owner, name)) + reason := "" + if err != nil { + reason = fmt.Sprintf(" - %s", err) + } + c.sendResult(fmt.Errorf("address %s is owned by other peer %s%s%s", c.cidr.String(), owner, name, reason)) } func (c *claim) Cancel() {