Fixing aliasing issues
This commit is contained in:
parent
8be7e3ac4e
commit
4cb233f48b
13
client.go
13
client.go
@ -188,8 +188,13 @@ func (c *client) query(params *QueryParam) error {
|
||||
inp = ensureName(inprogress, rr.Ptr)
|
||||
|
||||
case *dns.SRV:
|
||||
// Check for a target mismatch
|
||||
if rr.Target != rr.Hdr.Name {
|
||||
alias(inprogress, rr.Hdr.Name, rr.Target)
|
||||
}
|
||||
|
||||
// Get the port
|
||||
inp = ensureName(inprogress, rr.Target)
|
||||
inp = ensureName(inprogress, rr.Hdr.Name)
|
||||
inp.Port = int(rr.Port)
|
||||
|
||||
case *dns.TXT:
|
||||
@ -282,3 +287,9 @@ func ensureName(inprogress map[string]*ServiceEntry, name string) *ServiceEntry
|
||||
inprogress[name] = inp
|
||||
return inp
|
||||
}
|
||||
|
||||
// alias is used to setup an alias between two entries
|
||||
func alias(inprogress map[string]*ServiceEntry, src, dst string) {
|
||||
srcEntry := ensureName(inprogress, src)
|
||||
inprogress[dst] = srcEntry
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user