Skip to content

Commit

Permalink
Merge branch 'master' into qq-rule
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Mar 23, 2022
2 parents 7290a1c + b16b1d1 commit 1e2d500
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ and this project adheres to

### Changed

- Reverse DNS now has a greater priority as the source of runtime clients'
informmation than ARP neighborhood.
- Improved detection of runtime clients through more resilient ARP processing
([#3597]).
- The TTL of responses served from the optimistic cache is now lowered to 10
Expand Down
1 change: 0 additions & 1 deletion client/src/components/ui/Icons.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.icons {
display: inline-block;
vertical-align: middle;
height: 100%;
}

.icon--24 {
Expand Down
4 changes: 3 additions & 1 deletion internal/dnsforward/dnsforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,16 @@ func (s *Server) Exchange(ip net.IP) (host string, err error) {
StartTime: time.Now(),
}

resolver := s.internalProxy
var resolver *proxy.Proxy
if s.privateNets.Contains(ip) {
if !s.conf.UsePrivateRDNS {
return "", nil
}

resolver = s.localResolvers
s.recDetector.add(*req)
} else {
resolver = s.internalProxy
}

if err = resolver.Resolve(ctx); err != nil {
Expand Down
9 changes: 4 additions & 5 deletions internal/home/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ type clientSource uint
// Client sources. The order determines the priority.
const (
ClientSourceWHOIS clientSource = iota
ClientSourceRDNS
ClientSourceARP
ClientSourceRDNS
ClientSourceDHCP
ClientSourceHostsFile
)
Expand Down Expand Up @@ -723,9 +723,7 @@ func (clients *clientsContainer) AddHost(ip net.IP, host string, src clientSourc
clients.lock.Lock()
defer clients.lock.Unlock()

ok = clients.addHostLocked(ip, host, src)

return ok, nil
return clients.addHostLocked(ip, host, src), nil
}

// addHostLocked adds a new IP-hostname pairing. For internal use only.
Expand All @@ -737,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{
Expand Down Expand Up @@ -831,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++
}
}
Expand Down
8 changes: 3 additions & 5 deletions internal/home/rdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,12 @@ func (r *RDNS) workerLoop() {
log.Debug("rdns: resolving %q: %s", ip, err)

continue
}

if host == "" {
} else if host == "" {
continue
}

// Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
// Don't handle any errors since AddHost doesn't return non-nil errors
// for now.
_, _ = r.clients.AddHost(ip, host, ClientSourceRDNS)
}
}

0 comments on commit 1e2d500

Please sign in to comment.