mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/cli: do not substitute MAC if empty
Using IPv4 as hostname is enough to distinguish clients.
This commit is contained in:
committed by
Cuong Manh Le
parent
564c9ef712
commit
a2116e5eb5
@@ -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,
|
||||
// like VPN/Wireguard clients, so we use whatever MAC address associated with remoteIP
|
||||
// (most likely 127.0.0.1), and ci.IP as hostname, so we can distinguish those clients.
|
||||
// like VPN/Wireguard clients, so we use ci.IP as hostname to distinguish those clients.
|
||||
if ci.Mac == "" {
|
||||
ci.Mac = p.ciTable.LookupMac(remoteIP)
|
||||
if hostname := p.ciTable.LookupHostname(ci.IP, ""); hostname != "" {
|
||||
ci.Hostname = hostname
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user