mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
Initializing default os resolver during upstream bootstrap
Since calling defaultNameservers may block the whole bootstrap process if there's no valid DNS servers available.
This commit is contained in:
committed by
Cuong Manh Le
parent
7cea5305e1
commit
c4efa1ab97
@@ -437,8 +437,9 @@ func (uc *UpstreamConfig) UID() string {
|
||||
func (uc *UpstreamConfig) SetupBootstrapIP() {
|
||||
b := backoff.NewBackoff("setupBootstrapIP", func(format string, args ...any) {}, 10*time.Second)
|
||||
isControlD := uc.IsControlD()
|
||||
nss := initDefaultOsResolver()
|
||||
for {
|
||||
uc.bootstrapIPs = lookupIP(uc.Domain, uc.Timeout, defaultNameservers())
|
||||
uc.bootstrapIPs = lookupIP(uc.Domain, uc.Timeout, nss)
|
||||
// For ControlD upstream, the bootstrap IPs could not be RFC 1918 addresses,
|
||||
// filtering them out here to prevent weird behavior.
|
||||
if isControlD {
|
||||
|
||||
Reference in New Issue
Block a user