mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
internal/clientinfo: use all possible source IP for listing clients
This commit is contained in:
committed by
Cuong Manh Le
parent
46509be8a0
commit
e5389ffecb
@@ -40,6 +40,15 @@ func (p *ptrDiscover) String() string {
|
||||
return "ptr"
|
||||
}
|
||||
|
||||
func (p *ptrDiscover) List() []string {
|
||||
var ips []string
|
||||
p.hostname.Range(func(key, value any) bool {
|
||||
ips = append(ips, key.(string))
|
||||
return true
|
||||
})
|
||||
return ips
|
||||
}
|
||||
|
||||
func (p *ptrDiscover) lookupHostnameFromCache(ip string) string {
|
||||
if val, ok := p.hostname.Load(ip); ok {
|
||||
return val.(string)
|
||||
|
||||
Reference in New Issue
Block a user