mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-04-14 04:56:55 +02:00
tai64n: use proper nanoseconds offset
The code before was obviously wrong. Reported-by: Vlad Krasnov <vlad@cloudflare.com>
This commit is contained in:
parent
276bf973e8
commit
4fd55daafe
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue