[LEDE-DEV] mdnsd ignoring questions
John Crispin
john at phrozen.org
Wed Dec 14 09:01:24 PST 2016
On 14/12/2016 17:35, Cristian Morales Vega wrote:
> I have found a problem with mdnsd, but since I'm no expert in the
> protocol and would prefer to stay that way, could somebody comment on
> these?
>
> The problem is with service_reply_single()
> (https://git.lede-project.org/?p=project/mdnsd.git;a=blob;f=service.c;h=fe6e5a91d31bd3475e47b3775db3e3474b848de6;hb=HEAD#l153).
>
> The call to service_timeout() resets the timeout counter, but if the
> later strcmp(match, s->service) check fails, the service is not
> actually announced. Since service_reply() calls service_reply_single()
> for every single registered service, it means that every time an
> Android phone in the networks looks for a Chromecast it resets the
> timeout counter of the _ssh counter. And when later somebody asks for
> the _ssh service, mdnsd will fail to reply.
>
> I would be tempted to just get rid of the service_timeout() call. Why
> does it exist? There would really be a problem if mdnsd would reply to
> every single request, even when it has already replied to it half a
> second ago?
yes, this is specifically requested by the RFC. there is an example how
32 device will hog 100mbit if the resend threshold is not properly
implemented. i'll need to have a closer look at this in the next couple
of days. busy with other stuff today. i have put it onto my todo list.
John
> I could also change the order of the strcmp(match, s->service) and
> service_timeout() checks, but notice that when a device looks for a
> service via both IPv4 and IPv6 changing the order of the checks would
> still make it, for example, get a reply via IPv6 and not via IPv4
> (which I guess can be a good thing since it's just a duplicate?).
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>
More information about the Lede-dev
mailing list