From 878bda6e19a0d55525ea6b1600f3413e0c5d6a84 Mon Sep 17 00:00:00 2001 From: Ghanan Gowripalan Date: Fri, 24 Jan 2020 13:02:01 -0800 Subject: [PATCH] Lock the NIC when checking if an address is tentative PiperOrigin-RevId: 291426657 --- pkg/tcpip/stack/nic.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go index 79556a36f..7dad9a8cb 100644 --- a/pkg/tcpip/stack/nic.go +++ b/pkg/tcpip/stack/nic.go @@ -1208,6 +1208,9 @@ func (n *NIC) Stack() *Stack { // false. It will only return true if the address is associated with the NIC // AND it is tentative. func (n *NIC) isAddrTentative(addr tcpip.Address) bool { + n.mu.RLock() + defer n.mu.RUnlock() + ref, ok := n.mu.endpoints[NetworkEndpointID{addr}] if !ok { return false