all: unify code to handle static DNS file path

This commit is contained in:
Cuong Manh Le
2026-04-30 19:19:18 +07:00
committed by Cuong Manh Le
parent 5ce92abf1f
commit 6286a71f2a
8 changed files with 27 additions and 46 deletions
+2 -2
View File
@@ -158,7 +158,7 @@ func getDNSServers(ctx context.Context) ([]string, error) {
0, // DomainGuid - not needed
0, // SiteName - not needed
uintptr(flags), // Flags
uintptr(unsafe.Pointer(&info))) // DomainControllerInfo - output
uintptr(unsafe.Pointer(&info))) // DomainControllerInfo - output
if ret != 0 {
switch ret {
@@ -309,7 +309,7 @@ func getDNSServers(ctx context.Context) ([]string, error) {
Log(context.Background(), logger.Debug(),
"Failed to get interface by name %s: %v", drIfaceName, err)
} else {
staticNs, file := SavedStaticNameservers(drIface)
staticNs, file := SavedStaticNameserversAndPath(drIface)
Log(context.Background(), logger.Debug(),
"static dns servers from %s: %v", file, staticNs)
if len(staticNs) > 0 {