Skip to content

Commit

Permalink
cmd/cli: honoring "iface" value in resetDnsTask
Browse files Browse the repository at this point in the history
Otherwise, ctrld service command will always do reset DNS while it
should not.
  • Loading branch information
cuonglm committed Aug 26, 2024
1 parent 5af3ec4 commit 70b0c4f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2649,6 +2649,9 @@ func resetDnsTask(p *prog, s service.Service) task {
isCtrldInstalled := !errors.Is(err, service.ErrNotInstalled)
isCtrldRunning := status == service.StatusRunning
return task{func() error {
if iface == "" {
return nil
}
// Always reset DNS first, ensuring DNS setting is in a good state.
// resetDNS must use the "iface" value of current running ctrld
// process to reset what setDNS has done properly.
Expand Down

0 comments on commit 70b0c4f

Please sign in to comment.