Pull request: home: fix adding client

Merge in DNS/adguard-home from fix-arp-names to master

Updates #3597.

Squashed commit of the following:

commit b4737a342ab4c3685512bd1271a2dc9fa25256d0
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Mar 22 16:55:52 2022 +0300

    home: fix adding client
This commit is contained in:
Eugene Burkov 2022-03-22 18:28:43 +03:00
parent f8e45c13f3
commit b16b1d1d24

View file

@ -735,6 +735,7 @@ func (clients *clientsContainer) addHostLocked(ip net.IP, host string, src clien
return false
}
rc.Host = host
rc.Source = src
} else {
rc = &RuntimeClient{
@ -829,7 +830,7 @@ func (clients *clientsContainer) addFromSystemARP() {
added := 0
for _, n := range ns {
if clients.addHostLocked(n.IP, "", ClientSourceARP) {
if clients.addHostLocked(n.IP, n.Name, ClientSourceARP) {
added++
}
}