code: func (n *NIC) findEndpoint(protocol tcpip.NetworkProtocolNumber, address tcpip.Address, peb PrimaryEndpointBehavior) *referencedNetworkEndpoint {
  	id := NetworkEndpointID{address}
  
  	n.mu.RLock()
  	ref := n.endpoints[id]
  	if ref != nil && !ref.tryIncRef() {
  		ref = nil
  	}
  	spoofing := n.spoofing
  	n.mu.RUnlock()
  
  	if ref != nil || !spoofing {
  		return ref
  	}
  
  	// Try again with the lock in exclusive mode. If we still can't get the
  	// endpoint, create a new "temporary" endpoint. It will only exist while
  	// there's a route through it.
  	n.mu.Lock()
  	ref = n.endpoints[id]
  	if ref == nil || !ref.tryIncRef() {
  		ref, _ = n.addAddressLocked(protocol, address, peb, true)
  		if ref != nil {
  			ref.holdsInsertRef = false
  		}
  	}
  	n.mu.Unlock()
  	return ref
  }
docs: // findEndpoint finds the endpoint, if any, with the given address.