Fully close tunnels when CloseAllTunnels is called (#448)

This commit is contained in:
Nathan Brown
2021-04-26 10:42:24 -05:00
committed by GitHub
parent a0735dd7d5
commit 6f37280e8e
3 changed files with 12 additions and 5 deletions

View File

@@ -142,7 +142,7 @@ func (c *Control) CloseTunnel(vpnIP uint32, localOnly bool) bool {
)
}
c.f.closeTunnel(hostInfo)
c.f.closeTunnel(hostInfo, false)
return true
}
@@ -160,6 +160,8 @@ func (c *Control) CloseAllTunnels(excludeLighthouses bool) (closed int) {
if h.ConnectionState.ready {
c.f.send(closeTunnel, 0, h.ConnectionState, h, h.remote, []byte{}, make([]byte, 12, 12), make([]byte, mtu))
c.f.closeTunnel(h, true)
c.l.WithField("vpnIp", IntIp(h.hostId)).WithField("udpAddr", h.remote).
Debug("Sending close tunnel message")
closed++