diff --git a/home/clients.go b/home/clients.go index 061a8935..ad246171 100644 --- a/home/clients.go +++ b/home/clients.go @@ -206,6 +206,12 @@ func (clients *clientsContainer) Add(c Client) (bool, error) { } } + ch, ok := clients.ipHost[c.IP] + if ok { + c.WhoisInfo = ch.WhoisInfo + delete(clients.ipHost, c.IP) + } + clients.list[c.Name] = &c if len(c.IP) != 0 { clients.ipIndex[c.IP] = &c @@ -312,6 +318,12 @@ func (clients *clientsContainer) AddHost(ip, host string, source clientSource) ( clients.lock.Lock() defer clients.lock.Unlock() + // check index + _, ok := clients.ipIndex[ip] + if ok { + return false, nil + } + // check index c, ok := clients.ipHost[ip] if ok && c.Source > source {