summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/nic.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-18 02:27:25 +0000
committergVisor bot <gvisor-bot@google.com>2021-01-18 02:27:25 +0000
commitcfe357cafaf4dacc8e7371c0f21af7a7862d6d91 (patch)
tree667900f81baccc6b1310ce815408f064b43e5612 /pkg/tcpip/stack/nic.go
parent4d0fcb53e5a0dd280de04b5057b659d8e9a253a6 (diff)
parentf5736fa2bf91e1bb3fd9f9625dba8c800bf2adb5 (diff)
Merge release-20210112.0-41-gf5736fa2b (automated)
Diffstat (limited to 'pkg/tcpip/stack/nic.go')
-rw-r--r--pkg/tcpip/stack/nic.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go
index 9e106a161..0f545f255 100644
--- a/pkg/tcpip/stack/nic.go
+++ b/pkg/tcpip/stack/nic.go
@@ -49,6 +49,10 @@ type NIC struct {
// Must be accessed using atomic operations.
enabled uint32
+ // linkResQueue holds packets that are waiting for link resolution to
+ // complete.
+ linkResQueue packetsPendingLinkResolution
+
mu struct {
sync.RWMutex
spoofing bool
@@ -134,6 +138,7 @@ func newNIC(stack *Stack, id tcpip.NICID, name string, ep LinkEndpoint, ctx NICC
stats: makeNICStats(),
networkEndpoints: make(map[tcpip.NetworkProtocolNumber]NetworkEndpoint),
}
+ nic.linkResQueue.init()
nic.mu.packetEPs = make(map[tcpip.NetworkProtocolNumber]*packetEndpointList)
// Check for Neighbor Unreachability Detection support.
@@ -315,7 +320,7 @@ func (n *NIC) WritePacket(r *Route, gso *GSO, protocol tcpip.NetworkProtocolNumb
if ch, err := r.Resolve(nil); err != nil {
if err == tcpip.ErrWouldBlock {
r.Acquire()
- n.stack.linkResQueue.enqueue(ch, r, protocol, pkt)
+ n.linkResQueue.enqueue(ch, r, protocol, pkt)
return nil
}
return err