diff options
author | Adin Scannell <ascannell@google.com> | 2021-09-13 10:51:23 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-09-13 10:54:24 -0700 |
commit | 6bcacb2fd17fadefbc9fb2eed9059eb36ae2783b (patch) | |
tree | 744e285e7e29173e1063591f0d7d7f9eccf4afbc /pkg | |
parent | 63b1c736b3bbb71cc7019fddec0e706133a2f61e (diff) |
Support anonymous structs in checklocks.
Fixes #6558
PiperOrigin-RevId: 396393293
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/tcpip/stack/nic.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go index bb56ca9cb..a796942ab 100644 --- a/pkg/tcpip/stack/nic.go +++ b/pkg/tcpip/stack/nic.go @@ -41,17 +41,6 @@ func (l *linkResolver) confirmReachable(addr tcpip.Address) { var _ NetworkInterface = (*nic)(nil) -// TODO(https://gvisor.dev/issue/6558): Use an anonymous struct in nic for this -// once copylocks supports anonymous structs. -type packetEPs struct { - mu sync.RWMutex - - // eps is protected by the mutex, but the values contained in it are not. - // - // +checklocks:mu - eps map[tcpip.NetworkProtocolNumber]*packetEndpointList -} - // nic represents a "network interface card" to which the networking stack is // attached. type nic struct { @@ -85,7 +74,14 @@ type nic struct { promiscuous bool } - packetEPs packetEPs + packetEPs struct { + mu sync.RWMutex + + // eps is protected by the mutex, but the values contained in it are not. + // + // +checklocks:mu + eps map[tcpip.NetworkProtocolNumber]*packetEndpointList + } } // makeNICStats initializes the NIC statistics and associates them to the global |