mirror of
https://github.com/netbirdio/wireguard-go.git
synced 2026-05-22 17:08:51 -07:00
tai64n: use proper nanoseconds offset
The code before was obviously wrong. Reported-by: Vlad Krasnov <vlad@cloudflare.com>
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ func Now() Timestamp {
|
||||
var tai64n Timestamp
|
||||
now := time.Now()
|
||||
secs := base + uint64(now.Unix())
|
||||
nano := uint32(now.UnixNano())
|
||||
nano := uint32(now.Nanosecond())
|
||||
binary.BigEndian.PutUint64(tai64n[:], secs)
|
||||
binary.BigEndian.PutUint32(tai64n[8:], nano)
|
||||
return tai64n
|
||||
|
||||
Reference in New Issue
Block a user