#117 Incorrect handling of a unicast query


The mdns specification states about Legacy Unicast Responses in Section 6.7:

"If the source UDP port in a received Multicast DNS Query is
not port 5353, this indicates that the Querier originating the query
is a simple resolver. In this case, the Multicast DNS Responder MUST
send a UDP response directly back to the Querier, via unicast, to
the query packet's source IP address and port."

Therefore, when a Query with the source UDP port other than 5353 is sent to the network, all daemons are expected to reply with a response packet to that source port number when they have a matching service.

When both Avahi and Bonjour receive this kind of crafted query packet, they reply with a response packet to the requester's source IP address and port number as expected.
In contrast, JmDNS sends its answer to port 5353 (i.e., the port assigned to mDNS) which is not correct.

The specification also states about TTL value in the same section:

"The resource record TTL given in a legacy unicast response SHOULD NOT
be greater than ten seconds, even if the true TTL of the Multicast
DNS resource record is higher."

However, JmDNS sets the TTL of the resource records to 3599 seconds, while both Avahi and Bonjour configure the value to 10 seconds as stipulated in the specification.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks