Skip to content

Commit 0d5b525

Browse files
fix: issues from syncing with upstream
1 parent 97040a4 commit 0d5b525

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client/internal/dns/host_darwin.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (s *systemConfigurator) removeKeyFromSystemConfig(key string) error {
166166
}
167167

168168
func (s *systemConfigurator) addLocalDNS() error {
169-
if !s.systemDNSSettings.ServerIP.IsValid() || len(s.systemDNSSettings.Domains) == 0 {
169+
if len(s.systemDNSSettings.ServerIPs) == 0 || len(s.systemDNSSettings.Domains) == 0 {
170170
if err := s.recordSystemDNSSettings(true); err != nil {
171171
log.Errorf("Unable to get system DNS configuration")
172172
return fmt.Errorf("recordSystemDNSSettings(): %w", err)
@@ -243,7 +243,9 @@ func (s *systemConfigurator) getSystemDNSSettings() (SystemDNSSettings, error) {
243243
} else if inServerAddressesArray {
244244
address := strings.Split(line, " : ")[1]
245245
if ip, err := netip.ParseAddr(address); err == nil && ip.Is4() {
246-
dnsSettings.ServerIPs = append(dnsSettings.ServerIPs, ip)
246+
if ip.IsValid() {
247+
dnsSettings.ServerIPs = append(dnsSettings.ServerIPs, ip)
248+
}
247249
inServerAddressesArray = false // Stop reading after finding the first IPv4 address
248250
}
249251
}

0 commit comments

Comments
 (0)