Skip to content

Commit

Permalink
all: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Dec 12, 2023
1 parent d5edd02 commit 7411b40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func (r *Runtime) Info() (cs Source, host string) {
cs, info = SourceRDNS, r.rdns
case r.arp != nil:
cs, info = SourceARP, r.arp
case r.whois != nil:
cs = SourceWHOIS
}

if len(info) == 0 {
Expand Down
14 changes: 7 additions & 7 deletions internal/home/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,17 +569,17 @@ func (clients *clientsContainer) findRuntimeClient(ip netip.Addr) (rc *client.Ru
rc, ok = clients.runtimeClient(ip)
host := clients.dhcp.HostByIP(ip)

if !ok {
if host == "" {
return nil, false
if host != "" {
if !ok {
rc = &client.Runtime{}
}

rc = &client.Runtime{}
}
rc.SetInfo(client.SourceDHCP, []string{host})

rc.SetInfo(client.SourceDHCP, []string{host})
return rc, true
}

return rc, true
return rc, ok
}

// check validates the client.
Expand Down

0 comments on commit 7411b40

Please sign in to comment.