mirror of
https://github.com/jwhited/wgsd.git
synced 2025-01-18 13:59:34 +08:00
don't return SRV answer if endpoint is nil
This commit is contained in:
parent
5c7c582a2a
commit
dbe0623624
3
wgsd.go
3
wgsd.go
@ -76,6 +76,9 @@ func (p *WGSD) ServeDNS(ctx context.Context, w dns.ResponseWriter,
|
||||
// TODO: handle SOA
|
||||
case name == spPrefix && qtype == dns.TypePTR:
|
||||
for _, peer := range device.Peers {
|
||||
if peer.Endpoint == nil {
|
||||
continue
|
||||
}
|
||||
m.Answer = append(m.Answer, &dns.PTR{
|
||||
Hdr: dns.RR_Header{
|
||||
Name: state.Name(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user