Response filtering improved

This commit is contained in:
Neil Alexander 2020-05-10 13:19:18 +01:00
parent 21fa0eb4ff
commit 4c00928400
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -348,7 +348,13 @@ func (s *mDNSServer) listen() {
s.mdns.log.Debugln("Stopped listening for mDNS on", s.intf.Name) s.mdns.log.Debugln("Stopped listening for mDNS on", s.intf.Name)
return return
case entry := <-incoming: case entry := <-incoming:
if entry == nil {
return
}
suffix := fmt.Sprintf("%s.%s", MDNSService, MDNSDomain) suffix := fmt.Sprintf("%s.%s", MDNSService, MDNSDomain)
if len(entry.Name) <= len(suffix) {
continue
}
if entry.Name[len(entry.Name)-len(suffix):] != suffix { if entry.Name[len(entry.Name)-len(suffix):] != suffix {
continue continue
} }