resolvectl: improve error message if we do not support dumping payload of RR

This commit is contained in:
Lennart Poettering
2025-06-05 12:43:36 +02:00
parent 317054365e
commit 231a0417cd
+2
View File
@@ -493,6 +493,8 @@ static int output_rr_packet(const void *d, size_t l, int ifindex) {
ssize_t k;
k = dns_resource_record_payload(rr, &data);
if (k == -EINVAL)
return log_error_errno(k, "Dumping of binary payload not available for RRs of this type: %s", dns_type_to_string(rr->key->type));
if (k < 0)
return log_error_errno(k, "Cannot dump RR: %m");
fwrite(data, 1, k, stdout);