Fix sending replies to PTR questions
authorRafał Miłecki <rafal@milecki.pl>
Mon, 13 Feb 2017 15:42:35 +0000 (16:42 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Tue, 14 Feb 2017 21:05:08 +0000 (22:05 +0100)
commit70c66fbbcde868d2fe6034b5f706f1524e4f3d44
tree75a6f99517b371658d6590dea502020097b83b39
parentae4adf3736f43aea1a288d6693a1439ee04de969
Fix sending replies to PTR questions

When we receive PTR question it includes hostname (instance), e.g.:
mdnsd: parse_question (391): Q -> PTR lede._http._tcp.local

First of all we should check if it matches hostname we use before trying
to reply. Secondly service_reply expects service with domain appended
(without hostname/instance) so we need to strip received string out of
hostname before passing it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: John Crispin <john@phrozen.org>
dns.c