Pull request 2279: AG-27492-clients-runtime-sources-dhcp

Squashed commit of the following:

commit 51fb3e3d07752a33310b05d99726b248d3897335
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Thu Sep 19 17:01:03 2024 +0300

    all: upd chlog

commit 3ab945bb442c921ffbfa14c1dd2825f8ed307999
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Thu Sep 19 16:49:00 2024 +0300

    home: clients runtime sources dhcp
This commit is contained in:
Stanislav Chzhen
2024-09-19 20:01:16 +03:00
parent a74c32f742
commit e338214ad5
3 changed files with 17 additions and 10 deletions

View File

@@ -619,8 +619,11 @@ func (clients *clientsContainer) addHostLocked(
) (ok bool) {
rc := client.NewRuntime(ip)
rc.SetInfo(src, []string{host})
if dhcpHost := clients.dhcp.HostByIP(ip); dhcpHost != "" {
rc.SetInfo(client.SourceDHCP, []string{dhcpHost})
if config.Clients.Sources.DHCP {
if dhcpHost := clients.dhcp.HostByIP(ip); dhcpHost != "" {
rc.SetInfo(client.SourceDHCP, []string{dhcpHost})
}
}
clients.storage.UpdateRuntime(rc)