mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-16 13:17:19 +02:00
cmd/ctrld: optimizing set/reset DNS
Currently, when reset DNS, ctrld always find the net.Interface by interface name. This may produce unexpected error because the interface table may be cleared at the time ctrld is being stopped. Instead, we can get the net interface only once, and use that interface for restoring the DNS before shutting down. While at it, also making logging message clearer.
This commit is contained in:
committed by
Cuong Manh Le
parent
b0dc96aa01
commit
c82a0e2562
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -35,6 +36,7 @@ var (
|
||||
|
||||
cdUID string
|
||||
iface string
|
||||
netIface *net.Interface
|
||||
ifaceStartStop string
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user