mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-05 23:42:54 +03:00
cherry-pick: 4216 simpl hosts
Merge in DNS/adguard-home from 4216-hosts-explode to master Updates #4216. Squashed commit of the following: commit a6ed131923496d9bbd1d80c652d4584951528c4a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Jan 27 19:11:23 2022 +0300 aghnet: imp docs commit 25cca065c3c6dc227288cdd0803dc3ff8f9c3ca4 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Jan 27 18:53:16 2022 +0300 aghnet: simpl hosts container
This commit is contained in:
parent
bd584de4ee
commit
119100924c
6 changed files with 163 additions and 206 deletions
internal/home
|
@ -783,17 +783,14 @@ func (clients *clientsContainer) addFromHostsFile(hosts *netutil.IPMap) {
|
|||
|
||||
n := 0
|
||||
hosts.Range(func(ip net.IP, v interface{}) (cont bool) {
|
||||
hosts, ok := v.(*aghnet.Hosts)
|
||||
hosts, ok := v.(*stringutil.Set)
|
||||
if !ok {
|
||||
log.Error("dns: bad type %T in ipToRC for %s", v, ip)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
if clients.addHostLocked(ip, hosts.Main, ClientSourceHostsFile) {
|
||||
n++
|
||||
}
|
||||
hosts.Aliases.Range(func(name string) (cont bool) {
|
||||
hosts.Range(func(name string) (cont bool) {
|
||||
if clients.addHostLocked(ip, name, ClientSourceHostsFile) {
|
||||
n++
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue