mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-23 01:27:13 +02:00
cmd/cli: do not substitute MAC if empty
Using IPv4 as hostname is enough to distinguish clients.
This commit is contained in:
@@ -579,10 +579,8 @@ func (p *prog) getClientInfo(remoteIP string, msg *dns.Msg) *ctrld.ClientInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If MAC is still empty here, that mean the requests are made from virtual interface,
|
// If MAC is still empty here, that mean the requests are made from virtual interface,
|
||||||
// like VPN/Wireguard clients, so we use whatever MAC address associated with remoteIP
|
// like VPN/Wireguard clients, so we use ci.IP as hostname to distinguish those clients.
|
||||||
// (most likely 127.0.0.1), and ci.IP as hostname, so we can distinguish those clients.
|
|
||||||
if ci.Mac == "" {
|
if ci.Mac == "" {
|
||||||
ci.Mac = p.ciTable.LookupMac(remoteIP)
|
|
||||||
if hostname := p.ciTable.LookupHostname(ci.IP, ""); hostname != "" {
|
if hostname := p.ciTable.LookupHostname(ci.IP, ""); hostname != "" {
|
||||||
ci.Hostname = hostname
|
ci.Hostname = hostname
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user