Skip to content

Commit

Permalink
feat(executor): reset Dns first on closing
Browse files Browse the repository at this point in the history
  • Loading branch information
igoogolx committed Jan 12, 2025
1 parent 316c8f4 commit 9702483
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions internal/executor/tun.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ func (c *TunClient) Start() error {
func (c *TunClient) Close() error {
var err error

if c.config.HijackDns.Enabled {
err := dns.Resume(c.config.HijackDns.NetworkService, c.config.HijackDns.AlwaysReset)
if err != nil {
return err
}
}
statistic.DefaultManager.CloseAllConnections()
if err = c.tun.Close(); err != nil {
return err
Expand All @@ -79,12 +85,7 @@ func (c *TunClient) Close() error {
if err != nil {
return err
}
if c.config.HijackDns.Enabled {
err := dns.Resume(c.config.HijackDns.NetworkService, c.config.HijackDns.AlwaysReset)
if err != nil {
return err
}
}

if err = c.localserver.Close(); err != nil {
return err
}
Expand Down

0 comments on commit 9702483

Please sign in to comment.