More helpful error message when --ip-alloc-range mismatched

This commit is contained in:
Bryan Boreham committed 2015-07-17 11:42:30 +01:00
1 parent f4d6e028d4
commit 1f4b943454
3 files changed
+19

No files matched your search

+4
View File
@@ -613,6 +613,10 @@ func (alloc *Allocator) update(sender router.PeerName, msg []byte) error {
// shouldn't get updates for a empty Ring. But tolerate
// them just in case.
if data.Ring != nil {
if data.Ring.Range() != alloc.universe {
return fmt.Errorf("Incompatible IP allocation range %s; ours is %s",
data.Ring.Range().AsCIDRString(), alloc.universe.AsCIDRString())
}
err = alloc.ring.Merge(*data.Ring)
if !alloc.ring.Empty() {
alloc.pruneNicknames()