From: Dmitry Rozhkov Date: Fri, 2 Dec 2016 09:31:45 +0000 (+0200) Subject: resolved: adhere to RFC when handling mDNS goodbye packets X-Git-Tag: v233~108^2~10 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=3755027c2cada70345c96787a9b5569994dd23ed;p=systemd%2F.git resolved: adhere to RFC when handling mDNS goodbye packets Signed-off-by: Dmitry Rozhkov --- diff --git a/src/resolve/resolved-mdns.c b/src/resolve/resolved-mdns.c index 2efaa55d8d..48ec17f4b5 100644 --- a/src/resolve/resolved-mdns.c +++ b/src/resolve/resolved-mdns.c @@ -118,6 +118,12 @@ static int on_mdns_packet(sd_event_source *s, int fd, uint32_t revents, void *us dns_name_endswith(name, "local") > 0)) return 0; + if (rr->ttl == 0) { + log_debug("Got a goodbye packet"); + /* See the section 10.1 of RFC6762 */ + rr->ttl = 1; + } + t = dns_scope_find_transaction(scope, rr->key, false); if (t) dns_transaction_process_reply(t, p);