mjansson / mdns

Public domain mDNS/DNS-SD library in C
The Unlicense
437 stars 117 forks source link

Allow class type ANY in queries #54

Closed JeansHH closed 2 years ago

JeansHH commented 2 years ago

Currently only queries with class type INTERNET are accepted. But I faced a client (written in C#) that uses the class type ANY.

The standard rfc6762 states in section 6:

The determination of whether a given record answers a given question is made using the standard DNS rules: the record name must match the question name, the record rrtype must match the question qtype unless the qtype is "ANY" (255) or the rrtype is "CNAME" (5), and the record rrclass must match the question qclass unless the qclass is "ANY" (255). As with Unicast DNS, generally only DNS class 1 ("Internet") is used, but should client software use classes other than 1, the matching rules described above MUST be used.

As far as I understand it means other classes can be accepted if standard DNS rules are respected. But if class is ANY there should be no difference at all, isn't it?