From 02fec8dba5a6148e44da2715e26246a5d91e64fa Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Wed, 7 Jul 2021 13:27:38 -0700 Subject: Move time.Now() call to sniffer PiperOrigin-RevId: 383481745 --- pkg/tcpip/link/sniffer/pcap.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkg/tcpip/link/sniffer/pcap.go') diff --git a/pkg/tcpip/link/sniffer/pcap.go b/pkg/tcpip/link/sniffer/pcap.go index c16c19647..45475dcf1 100644 --- a/pkg/tcpip/link/sniffer/pcap.go +++ b/pkg/tcpip/link/sniffer/pcap.go @@ -55,8 +55,7 @@ type pcapPacketHeader struct { OriginalLength uint32 } -func newPCAPPacketHeader(incLen, orgLen uint32) pcapPacketHeader { - now := time.Now() +func newPCAPPacketHeader(now time.Time, incLen, orgLen uint32) pcapPacketHeader { return pcapPacketHeader{ Seconds: uint32(now.Unix()), Microseconds: uint32(now.Nanosecond() / 1000), -- cgit v1.2.3