From a2116e5eb530f410519cdca2f0f434117a262527 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 17 Nov 2023 17:35:42 +0700 Subject: [PATCH] cmd/cli: do not substitute MAC if empty Using IPv4 as hostname is enough to distinguish clients. --- cmd/cli/dns_proxy.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/cli/dns_proxy.go b/cmd/cli/dns_proxy.go index 77ec44e..855e5d3 100644 --- a/cmd/cli/dns_proxy.go +++ b/cmd/cli/dns_proxy.go @@ -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 {