From 69f526b13d1f553dfcd3e3bad363c2ac148bef54 Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Wed, 14 Apr 2021 19:18:48 +0300 Subject: [PATCH] Pull request: 2956 fix clients disabling Merge in DNS/adguard-home from 2956-fix-flag to master Closes #2956. Updates #1947. Squashed commit of the following: commit ffb98f752f6d4c40ea166ff1e482edcd7f028513 Merge: 800d67db 7be2fc37 Author: Eugene Burkov Date: Wed Apr 14 19:01:34 2021 +0300 Merge branch 'master' into 2956-fix-flag commit 800d67db84786c8fe93d38b6aa932aa4dd4dd345 Author: Eugene Burkov Date: Wed Apr 14 18:54:26 2021 +0300 home: fix clients disabling --- internal/home/clients.go | 4 +--- internal/home/home.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/home/clients.go b/internal/home/clients.go index 6d22bb19..882f5586 100644 --- a/internal/home/clients.go +++ b/internal/home/clients.go @@ -117,9 +117,7 @@ func (clients *clientsContainer) Init( } clients.dhcpServer = dhcpServer - if etcHosts != nil { - clients.etcHosts = etcHosts - } + clients.etcHosts = etcHosts clients.addFromConfig(objects) if !clients.testing { diff --git a/internal/home/home.go b/internal/home/home.go index a4c863de..62764e4e 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -201,8 +201,8 @@ func setupConfig(args options) { if !args.noEtcHosts { Context.etcHosts = &aghnet.EtcHostsContainer{} Context.etcHosts.Init("") - Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts) } + Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts) config.Clients = nil if (runtime.GOOS == "linux" || runtime.GOOS == "darwin") &&