_cleanup_free_ char *s = NULL;
char label[DNS_LABEL_MAX];
size_t n;
+ int k;
n = PTR_TO_SIZE(hashmap_get(p->names, name));
if (n > 0) {
if (r < 0)
goto fail;
+ if (p->protocol == DNS_PROTOCOL_DNS)
+ k = dns_label_apply_idna(label, r, label, sizeof(label));
+ else
+ k = dns_label_undo_idna(label, r, label, sizeof(label));
+ if (k < 0) {
+ r = k;
+ goto fail;
+ }
+ if (k > 0)
+ r = k;
+
r = dns_packet_append_label(p, label, r, &n);
if (r < 0)
goto fail;