diff --git a/ipam/allocator.go b/ipam/allocator.go index d5ce2530..e2b24062 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -512,9 +512,11 @@ func (alloc *Allocator) OnGossipUnicast(sender mesh.PeerName, msg []byte) error alloc.actionChan <- func() { switch msg[0] { case msgSpaceRequest: - // some other peer asked us for space + alloc.debugln("Peer", sender, "asked me for space") r, err := decodeRange(msg[1:]) - if err == nil { + // If we don't have a ring, just ignore a request for space. + // They'll probably ask again later. + if err == nil && !alloc.ring.Empty() { alloc.donateSpace(r, sender) } resultChan <- err @@ -823,7 +825,6 @@ func (alloc *Allocator) donateSpace(r address.Range, to mesh.PeerName) { // more. defer alloc.sendRingUpdate(to) - alloc.debugln("Peer", to, "asked me for space") chunk, ok := alloc.space.Donate(r) if !ok { free := alloc.space.NumFreeAddressesInRange(r)