mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 04:06:35 +02:00
wgengine/netstack: release lock early on addSubnetAddress
Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
parent
4c22967a81
commit
47bd3c4cf5
@ -189,11 +189,12 @@ func (ns *Impl) updateDNS(nm *netmap.NetworkMap) {
|
||||
func (ns *Impl) addSubnetAddress(pn tcpip.NetworkProtocolNumber, ip netaddr.IP) {
|
||||
ns.mu.Lock()
|
||||
ns.connsOpenBySubnetIP[ip]++
|
||||
needAdd := ns.connsOpenBySubnetIP[ip] == 1
|
||||
ns.mu.Unlock()
|
||||
// Only register address into netstack for first concurrent connection.
|
||||
if ns.connsOpenBySubnetIP[ip] == 1 {
|
||||
if needAdd {
|
||||
ns.ipstack.AddAddress(nicID, pn, tcpip.Address(ip.IPAddr().IP))
|
||||
}
|
||||
ns.mu.Unlock()
|
||||
}
|
||||
|
||||
func (ns *Impl) removeSubnetAddress(ip netaddr.IP) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user