Use different initialize order for DNS resolver in android/nonandroid clients (#952)

This commit is contained in:
Givi Khojanashvili 2023-06-13 11:20:29 +04:00 committed by GitHub
parent ff267768f0
commit 042f124702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,7 +199,7 @@ func (e *Engine) Start() error {
}
}
if e.dnsServer == nil {
if e.dnsServer == nil && runtime.GOOS == "android" {
// todo fix custom address
dnsServer, err := dns.NewDefaultServer(e.ctx, e.wgInterface, e.config.CustomDNSAddress, dnsCfg)
if err != nil {
@ -259,6 +259,16 @@ func (e *Engine) Start() error {
e.acl = acl
}
if e.dnsServer == nil && runtime.GOOS != "android" {
// todo fix custom address
dnsServer, err := dns.NewDefaultServer(e.ctx, e.wgInterface, e.config.CustomDNSAddress, dnsCfg)
if err != nil {
e.close()
return err
}
e.dnsServer = dnsServer
}
e.receiveSignalEvents()
e.receiveManagementEvents()