+/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
r = dns_name_apply_idna(name, &buf);
if (r < 0)
return r;
-
- name = buf;
+ if (r > 0 && !streq(name, buf))
+ name = buf;
+ else
+ /* We did not manage to create convert the idna name, or it's
+ * the same as the original name. We assume the caller already
+ * created an uncoverted question, so let's not repeat work
+ * unnecessarily. */
+ return -EALREADY;
}
q = dns_question_new(family == AF_UNSPEC ? 2 : 1);
r = dns_name_apply_idna(domain, &buf);
if (r < 0)
return r;
-
- domain = buf;
+ if (r > 0)
+ domain = buf;
}
r = dns_service_join(service, type, domain, &joined);