diff --git a/ipam/allocator.go b/ipam/allocator.go index 655ec07b..0b151c67 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -469,7 +469,7 @@ func (alloc *Allocator) OnGossipBroadcast(sender mesh.PeerName, msg []byte) (mes type gossipState struct { // We send a timstamp along with the information to be - // gossipped in order to detect skewed clocks + // gossipped for backwards-compatibility (previously to detect skewed clocks) Now int64 Nicknames map[mesh.PeerName]string @@ -673,11 +673,6 @@ func (alloc *Allocator) update(sender mesh.PeerName, msg []byte) error { return err } - deltat := time.Unix(data.Now, 0).Sub(alloc.now()) - if deltat > time.Hour || -deltat > time.Hour { - return fmt.Errorf("clock skew of %v detected, ignoring update", deltat) - } - // Merge nicknames for peer, nickname := range data.Nicknames { alloc.nicknames[peer] = nickname diff --git a/ipam/allocator_test.go b/ipam/allocator_test.go index 5fae2dfb..6845756f 100644 --- a/ipam/allocator_test.go +++ b/ipam/allocator_test.go @@ -577,18 +577,6 @@ func TestAllocatorFuzz(t *testing.T) { }) } -func TestGossipSkew(t *testing.T) { - alloc1, _ := makeAllocatorWithMockGossip(t, "01:00:00:01:00:00", "10.0.1.0/22", 2) - defer alloc1.Stop() - alloc2, _ := makeAllocatorWithMockGossip(t, "02:00:00:02:00:00", "10.0.1.0/22", 2) - alloc2.now = func() time.Time { return time.Now().Add(time.Hour * 2) } - defer alloc2.Stop() - - if _, err := alloc1.OnGossipBroadcast(alloc2.ourName, alloc2.Encode()); err == nil { - t.Fail() - } -} - func TestSpaceRequest(t *testing.T) { const ( container1 = "cont-1"