-
Notifications
You must be signed in to change notification settings - Fork 484
Description
Hi,
Apologies if I am looking in the wrong place for this. In #669 one-shot mDNS support was added which I am currently attempting to get working with Embassy and a STM32H7. I have been analysing the packets sent between my mDNS server and the device to identify my problem and notice.
In RFC6762 Section 6 it states:
Multicast DNS responses MUST NOT contain any questions in the
Question Section. Any questions in the Question Section of a
received Multicast DNS response MUST be silently ignored. Multicast
DNS queriers receiving Multicast DNS responses do not care what
question elicited the response; they care only that the information
in the response is true and accurate.
I have also verified with multiple mDNS resolvers the responses they give never include any questions. In the below code there is a check explicitly for question_count != 1
which causes the process function to stop if it's 0 causing the response to be ignored and the mDNS resolver failing to resolve the dns name.
https://github.com/smoltcp-rs/smoltcp/blob/main/src/socket/dns.rs#L416
if p.question_count() != 1 {
net_trace!("bad question count {:?}", p.question_count());
return;
}
My suggestion is in the process()
function we check the functions UdpRepr port udp_repr.dst_port
to see if it equals MDNS_DNS_PORT
and if it does we skip the question check but I do not really have a good enough understanding to know if this would be a good enough solution.
If it would help I can provide a full example but it does seem to be just that check which is failing.
Thanks,
Sam