diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-10-01 19:41:35 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-01 19:41:35 +0000 |
commit | 180c102cce36336892caa2ebf62359ec7c20322a (patch) | |
tree | 16beb9d1db42b34be6beee6b18d655e1ac91231c /pkg/tcpip/stack/iptables_state.go | |
parent | 147b72a9384e9434c633488a3eb88a5b9601adf8 (diff) | |
parent | 8603cce51d6d930aed128fff873591520dcb0853 (diff) |
Merge release-20210921.0-55-g8603cce51 (automated)
Diffstat (limited to 'pkg/tcpip/stack/iptables_state.go')
-rw-r--r-- | pkg/tcpip/stack/iptables_state.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/iptables_state.go b/pkg/tcpip/stack/iptables_state.go index 529e02a07..3d3c39c20 100644 --- a/pkg/tcpip/stack/iptables_state.go +++ b/pkg/tcpip/stack/iptables_state.go @@ -26,11 +26,15 @@ type unixTime struct { // saveLastUsed is invoked by stateify. func (cn *conn) saveLastUsed() unixTime { + cn.mu.Lock() + defer cn.mu.Unlock() return unixTime{cn.lastUsed.Unix(), cn.lastUsed.UnixNano()} } // loadLastUsed is invoked by stateify. func (cn *conn) loadLastUsed(unix unixTime) { + cn.mu.Lock() + defer cn.mu.Unlock() cn.lastUsed = time.Unix(unix.second, unix.nano) } |