Lock the NIC when checking if an address is tentative
PiperOrigin-RevId: 291426657
This commit is contained in:
parent
d135b5abf6
commit
878bda6e19
|
@ -1208,6 +1208,9 @@ func (n *NIC) Stack() *Stack {
|
||||||
// false. It will only return true if the address is associated with the NIC
|
// false. It will only return true if the address is associated with the NIC
|
||||||
// AND it is tentative.
|
// AND it is tentative.
|
||||||
func (n *NIC) isAddrTentative(addr tcpip.Address) bool {
|
func (n *NIC) isAddrTentative(addr tcpip.Address) bool {
|
||||||
|
n.mu.RLock()
|
||||||
|
defer n.mu.RUnlock()
|
||||||
|
|
||||||
ref, ok := n.mu.endpoints[NetworkEndpointID{addr}]
|
ref, ok := n.mu.endpoints[NetworkEndpointID{addr}]
|
||||||
if !ok {
|
if !ok {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue