mirror of
https://github.com/qdm12/gluetun.git
synced 2025-12-10 10:45:38 -06:00
fix(dns): prevent dns restart crash if DOT=off and DNS_KEEP_NAMESERVER=off
This commit is contained in:
parent
7450424849
commit
cba6070300
@ -74,7 +74,8 @@ func (l *Loop) runWait(ctx context.Context, runError <-chan error) (exitLoop boo
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
if !*l.GetSettings().KeepNameserver {
|
settings := l.GetSettings()
|
||||||
|
if !*settings.KeepNameserver && *settings.DoT.Enabled {
|
||||||
l.stopServer()
|
l.stopServer()
|
||||||
// TODO revert OS and Go nameserver when exiting
|
// TODO revert OS and Go nameserver when exiting
|
||||||
}
|
}
|
||||||
@ -82,7 +83,8 @@ func (l *Loop) runWait(ctx context.Context, runError <-chan error) (exitLoop boo
|
|||||||
case <-l.stop:
|
case <-l.stop:
|
||||||
l.userTrigger = true
|
l.userTrigger = true
|
||||||
l.logger.Info("stopping")
|
l.logger.Info("stopping")
|
||||||
if !*l.GetSettings().KeepNameserver {
|
settings := l.GetSettings()
|
||||||
|
if !*settings.KeepNameserver && *settings.DoT.Enabled {
|
||||||
const fallback = false
|
const fallback = false
|
||||||
l.useUnencryptedDNS(fallback)
|
l.useUnencryptedDNS(fallback)
|
||||||
l.stopServer()
|
l.stopServer()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user