Skip to content

Commit

Permalink
Merge pull request oleksandr#1 from grandcat/require-IP-for-ServiceEntry
Browse files Browse the repository at this point in the history
Client: wait for resolved IP addresses before being valid
  • Loading branch information
grandcat authored Jul 25, 2016
2 parents e16f7d3 + 5fa27e2 commit 27d2bc8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
"sync"

"github.com/miekg/dns"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
"github.com/miekg/dns"
)

// Main client data structure to run browse/lookup queries
Expand Down Expand Up @@ -226,6 +226,10 @@ func (c *client) mainloop(params *LookupParams) {
if _, ok := sentEntries[k]; ok {
continue
}
// Require at least one resolved IP address for ServiceEntry
if e.AddrIPv4 == nil && e.AddrIPv6 == nil {
continue
}
params.Entries <- e
sentEntries[k] = e
}
Expand Down

0 comments on commit 27d2bc8

Please sign in to comment.