Fix/dns initialization (#954)

The systemd HostManagers require valid, initialized network interface
This commit is contained in:
Zoltan Papp
2023-06-15 12:25:18 +02:00
committed by GitHub
parent 042f124702
commit f1b38dbe80
4 changed files with 37 additions and 25 deletions

View File

@ -199,7 +199,7 @@ func (e *Engine) Start() error {
}
}
if e.dnsServer == nil && runtime.GOOS == "android" {
if e.dnsServer == nil {
// todo fix custom address
dnsServer, err := dns.NewDefaultServer(e.ctx, e.wgInterface, e.config.CustomDNSAddress, dnsCfg)
if err != nil {
@ -259,14 +259,10 @@ 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
err = e.dnsServer.Initialize()
if err != nil {
e.close()
return err
}
e.receiveSignalEvents()