From 9ff73cb02f0b496d23525e5584c6728e58f1ac94 Mon Sep 17 00:00:00 2001 From: Nate Brown Date: Mon, 3 May 2021 14:10:00 -0500 Subject: [PATCH] Increase the timestamp resolution for handshakes (#453) --- handshake_ix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handshake_ix.go b/handshake_ix.go index 5fc5825..875af0f 100644 --- a/handshake_ix.go +++ b/handshake_ix.go @@ -31,7 +31,7 @@ func ixHandshakeStage0(f *Interface, vpnIp uint32, hostinfo *HostInfo) { hsProto := &NebulaHandshakeDetails{ InitiatorIndex: hostinfo.localIndexId, - Time: uint64(time.Now().Unix()), + Time: uint64(time.Now().UnixNano()), Cert: ci.certState.rawCertificateNoKey, } @@ -140,7 +140,7 @@ func ixHandshakeStage1(f *Interface, addr *udpAddr, packet []byte, h *Header) { hs.Details.ResponderIndex = myIndex hs.Details.Cert = ci.certState.rawCertificateNoKey // Update the time in case their clock is way off from ours - hs.Details.Time = uint64(time.Now().Unix()) + hs.Details.Time = uint64(time.Now().UnixNano()) hsBytes, err := proto.Marshal(hs) if err != nil {