- clients: fix incorrect info for clients from /etc/hosts
Close #1786 Squashed commit of the following: commit fc662252be38f20c9afda46fcb578efa50c9baf2 Author: Simon Zolin <s.zolin@adguard.com> Date: Thu Jun 11 10:57:26 2020 +0300 - clients: fix incorrect info for clients from /etc/hosts
This commit is contained in:
@@ -612,15 +612,13 @@ func (clients *clientsContainer) addFromHostsFile() {
|
||||
_ = clients.rmHosts(ClientSourceHostsFile)
|
||||
|
||||
n := 0
|
||||
for ip, names := range hosts {
|
||||
for _, name := range names {
|
||||
ok, err := clients.addHost(ip, name.String(), ClientSourceHostsFile)
|
||||
if err != nil {
|
||||
log.Debug("Clients: %s", err)
|
||||
}
|
||||
if ok {
|
||||
n++
|
||||
}
|
||||
for ip, name := range hosts {
|
||||
ok, err := clients.addHost(ip, name, ClientSourceHostsFile)
|
||||
if err != nil {
|
||||
log.Debug("Clients: %s", err)
|
||||
}
|
||||
if ok {
|
||||
n++
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user