mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-03-25 23:30:41 +01:00
internal/clientinfo: map ::1 to the right host MAC address
So queries originating from host using ::1 as source will be recognized properly, and treated the same as other queries from host itself.
This commit is contained in:
committed by
Cuong Manh Le
parent
b5cf0e2b31
commit
dd9f2465be
@@ -820,11 +820,7 @@ func (p *prog) getClientInfo(remoteIP string, msg *dns.Msg) *ctrld.ClientInfo {
|
||||
// If this is a query from self, but ci.IP is not loopback IP,
|
||||
// try using hostname mapping for lookback IP if presents.
|
||||
if ci.Self {
|
||||
loopbackIP := "127.0.0.1"
|
||||
if isV6 {
|
||||
loopbackIP = "::1"
|
||||
}
|
||||
if name := p.ciTable.LookupHostname(loopbackIP, ""); name != "" {
|
||||
if name := p.ciTable.LocalHostname(isV6); name != "" {
|
||||
ci.Hostname = name
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user