]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: tweak logs about truncation
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 8 Nov 2023 12:23:19 +0000 (21:23 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 8 Nov 2023 13:45:07 +0000 (22:45 +0900)
src/resolve/resolved-manager.c

index fc8d7412fbad6f200c37454eb92755926f6f58fc..b52619e287b433c490f9a2234ad1b45796a77449 100644 (file)
@@ -1198,8 +1198,11 @@ int manager_send(
         assert(port > 0);
         assert(p);
 
+        /* For mDNS, it is natural that the packet have truncated flag when we have many known answers. */
+        bool truncated = DNS_PACKET_TC(p) && (p->protocol != DNS_PROTOCOL_MDNS || !p->more);
+
         log_debug("Sending %s%s packet with id %" PRIu16 " on interface %i/%s of size %zu.",
-                  DNS_PACKET_TC(p) ? "truncated (!) " : "",
+                  truncated ? "truncated (!) " : "",
                   DNS_PACKET_QR(p) ? "response" : "query",
                   DNS_PACKET_ID(p),
                   ifindex, af_to_name(family),