mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
wgengine/magicsock: simplify
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
d2529affa2
commit
7c76435bf7
@ -2253,11 +2253,10 @@ func (c *Conn) LastMark() uint32 { return 0 }
|
|||||||
// Only the first close does anything. Any later closes return nil.
|
// Only the first close does anything. Any later closes return nil.
|
||||||
func (c *Conn) Close() error {
|
func (c *Conn) Close() error {
|
||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
if c.closed {
|
if c.closed {
|
||||||
c.mu.Unlock()
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
defer c.mu.Unlock()
|
|
||||||
|
|
||||||
for _, ep := range c.endpointOfDisco {
|
for _, ep := range c.endpointOfDisco {
|
||||||
ep.stopAndReset()
|
ep.stopAndReset()
|
||||||
|
Loading…
Reference in New Issue
Block a user