brutella / dnssd

This library implements Multicast DNS (mDNS) and DNS-Based Service Discovery (DNS-SD) for Zero Configuration Networking in Go.
MIT License
207 stars 33 forks source link

Rediscovery services and mdns #11

Closed ErwanMAS closed 4 years ago

ErwanMAS commented 5 years ago

I use this package to manage some hardware , my source is her https://github.com/ErwanMAS/godfrey4home/blob/master/src/homekit-switch.go .

After registration , and a long time . When i restart , the bridge , my iphone can not reconnect to the hk bridge .

I ran some tcpdump on 5353 , and i saw that the phone always made a query on _hap._tcp.local. PTR .

The mdns hc bridge provide by /brutella/hc/ , does not reply , with a answer .

If i comment this line , i have what i think the good behavior, the bridge reply with a response to himself .

https://github.com/brutella/dnssd/blob/61d1bc6e53ace5b3d9ecb46ffd0b3158c00ae9d0/responder.go#L437

I think the object req.msg.Answer , must not store answers from his own local services .

brutella commented 5 years ago

This mechanism is described in RFC 6762 7.1 as Known-Answer Suppression.

A Multicast DNS responder MUST NOT answer a Multicast DNS query if the answer it would give is already included in the Answer Section with an RR TTL at least half the correct value.

brutella commented 4 years ago

Do you have any reference that the responder always has to respond with a message including its own local service, even though the answer is already in the Answer Section?

ErwanMAS commented 4 years ago

i dont have more insight, or test case , you can close , if you want .

ErwanMAS commented 4 years ago

My last version run only with my pull request ( #12 )

brutella commented 4 years ago

12 is now merged