Don't do unnecessary clock skew check in IPAM

This commit is contained in:
Bryan Boreham committed 2016-03-10 11:41:47 +00:00
1 parent 3ad9d8e785
commit a57335738d
2 files changed
+1 -18

No files matched your search

+1 -6
View File
@@ -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