mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-06 20:10:11 +02:00
fix(dns): prevent dns restart crash if DOT=off and DNS_KEEP_NAMESERVER=off
This commit is contained in:
+4
-2
@@ -82,7 +82,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.ServerEnabled {
|
||||||
l.stopServer()
|
l.stopServer()
|
||||||
// TODO revert OS and Go nameserver when exiting
|
// TODO revert OS and Go nameserver when exiting
|
||||||
}
|
}
|
||||||
@@ -90,7 +91,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.ServerEnabled {
|
||||||
const fallback = false
|
const fallback = false
|
||||||
l.useUnencryptedDNS(fallback)
|
l.useUnencryptedDNS(fallback)
|
||||||
l.stopServer()
|
l.stopServer()
|
||||||
|
|||||||
Reference in New Issue
Block a user