From 211bbf82ad2f490ed7215568c2065d76dfa682ca Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Mon, 18 Oct 2021 15:07:06 -0700 Subject: conntrack: use tcpip.Clock instead of time.Time - We should be using a monotonic clock - This will make future testing easier Updates #6748. PiperOrigin-RevId: 404072318 --- pkg/tcpip/stack/stack.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/tcpip/stack/stack.go') diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 428350f31..ee6767654 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -238,7 +238,7 @@ type Options struct { // DefaultIPTables is an optional iptables rules constructor that is called // if IPTables is nil. If both fields are nil, iptables will allow all // traffic. - DefaultIPTables func(uint32) *IPTables + DefaultIPTables func(seed uint32, clock tcpip.Clock) *IPTables // SecureRNG is a cryptographically secure random number generator. SecureRNG io.Reader @@ -358,7 +358,7 @@ func New(opts Options) *Stack { if opts.DefaultIPTables == nil { opts.DefaultIPTables = DefaultTables } - opts.IPTables = opts.DefaultIPTables(seed) + opts.IPTables = opts.DefaultIPTables(seed, clock) } opts.NUDConfigs.resetInvalidFields() -- cgit v1.2.3