From 008d4ab7a2d06d719fe9d054a0b1bc9495e3a797 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov Date: Fri, 13 Oct 2017 12:19:21 +0300 Subject: [PATCH] resolved: make rfc4795-specific code run for LLMNR only RFC6762 specifies different procedure for conflict resolution and the code is not applicable for the mDNS case. --- src/resolve/resolved-dns-zone.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/resolve/resolved-dns-zone.c b/src/resolve/resolved-dns-zone.c index 53a4928..4e543ce 100644 --- a/src/resolve/resolved-dns-zone.c +++ b/src/resolve/resolved-dns-zone.c @@ -526,7 +526,9 @@ void dns_zone_item_notify(DnsZoneItem *i) { bool we_lost = false; /* The probe got a successful reply. If we so far - * weren't established we just give up. If we already + * weren't established we just give up. + * + * In LLMNR case if we already * were established, and the peer has the * lexicographically larger IP address we continue * and defend it. */ @@ -534,7 +536,7 @@ void dns_zone_item_notify(DnsZoneItem *i) { if (!IN_SET(i->state, DNS_ZONE_ITEM_ESTABLISHED, DNS_ZONE_ITEM_VERIFYING)) { log_debug("Got a successful probe for not yet established RR, we lost."); we_lost = true; - } else { + } else if (i->probe_transaction->scope->protocol == DNS_PROTOCOL_LLMNR) { assert(i->probe_transaction->received); we_lost = memcmp(&i->probe_transaction->received->sender, &i->probe_transaction->received->destination, FAMILY_ADDRESS_SIZE(i->probe_transaction->received->family)) < 0; if (we_lost) -- 2.7.4