[LEDE-DEV] [PATCH mdns 3/3] Ignore timeout in service_reply()

Cristian Morales Vega cristian at samknows.com
Thu Apr 27 00:46:21 PDT 2017


On 26 April 2017 at 09:45, Cristian Morales Vega <cristian at samknows.com> wrote:
> Signed-off-by: Cristian Morales Vega <cristian at samknows.com>
> ---
>  service.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/service.c b/service.c
> index ca70274..e4cc4b5 100644
> --- a/service.c
> +++ b/service.c
> @@ -148,7 +148,7 @@ service_reply(struct interface *iface, struct sockaddr *to, const char *match, i
>
>         vlist_for_each_element(&services, s, node) {
>                 if (!match || !strcmp(s->service, match))
> -                       service_reply_single(iface, to, s, ttl, 0);
> +                       service_reply_single(iface, to, s, ttl, 1);
>         }
>  }
>
> --
> 2.9.3
>

Sorry for the confusion, I was planning to write this immediately but..
These three patches are for mdnsd/umdns. I forgot to include a mdns
reference in the subject, and the commit message could be more
verbose. But I am not really expecting them to be committed as they
are. It's more of a "does this make sense" patch?

The problem I have found is that:
a) Patch 2
There were no replies to PTR questions send by avahi-browser (so the
whole thing breaks, just seems to work because at startup the
information is sent without nobody asking)
I think this is a bug. That the hostname is only supposed to be there
in SRV questions. But I'm not 100% sure if the hostname can be there
in PTR questions is some situations.

b) Patch 1
Probably because umdns sends the PTR reply in two packets, one with
the PTR answer and one with the SRV answer, I have got reports that
Apple devices (Bonjour I guess) are not happy enough. They seem to
repeatedly start asking for the SRV record, even if has already been
sent as answer to the PTR question and the Apple client library
reports failure as if the SRV reply was never sent.
So it needs to reply to SRV questions (probably it should anyway, right?)

c) Patch3
This is the one I'm more unsure of. In
http://lists.infradead.org/pipermail/lede-dev/2016-December/004665.html
I was told that the timeout is really important, but I have been
unable to find any reference to it in the RFC.
The thing is that without this Patch 1 fails to fix the problem with
Apple devices. The Apple device ask for the PTR, it receives the SRV
answer. Then it *immediately* ask for the SRV answer... which umdns
ignores, even if now it handles SRV questions, because of the timeout.
So I needed to get rid of the timeout.

With these three patches the Apple user is now happy. But I'm still
scared about that "32 device will hog 100mbit if the resend threshold
is not properly" in the December 2016 email referenced before.



More information about the Lede-dev mailing list