]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: do not log about negative cache for mdns packets
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Jun 2018 12:01:36 +0000 (21:01 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 20 Jun 2018 06:25:10 +0000 (08:25 +0200)
Fixes #9335.

src/resolve/resolved-dns-cache.c

index a44872b93d728a74206ad7dc3b3de4f420cc7622..23cd662fb884020e7f20f3bb0544ef4f067c8d62 100644 (file)
@@ -649,12 +649,13 @@ int dns_cache_put(
          * short time.) */
 
         if (IN_SET(rcode, DNS_RCODE_SUCCESS, DNS_RCODE_NXDOMAIN)) {
-
                 if (dns_answer_size(answer) <= 0) {
-                        char key_str[DNS_RESOURCE_KEY_STRING_MAX];
+                        if (key) {
+                                char key_str[DNS_RESOURCE_KEY_STRING_MAX];
 
-                        log_debug("Not caching negative entry without a SOA record: %s",
-                                  dns_resource_key_to_string(key, key_str, sizeof key_str));
+                                log_debug("Not caching negative entry without a SOA record: %s",
+                                          dns_resource_key_to_string(key, key_str, sizeof key_str));
+                        }
                         return 0;
                 }