this issue was fixed in libidn2 release of version 2.0.3. You workaround
could be disabled for releases with IDN2_VERSION_NUMBER >= 0x02000003.
Attaching small example patch.
Dne 8.7.2017 v 22:27 Simon Kelley napsal(a):
> I considered not passing SRV record names to IDN, but I can forsee
> more subtle problems (We allow _ in hostnames, for instance.) So I've
> fixed this, for some value of "fixed", by not passing any domain name
> being parsed, which has one or more underscores, to IDN.
> That seems a reasonable solution.
> On 07/07/17 15:12, Petr Menšík wrote:
>> Hi, I was the original contributor of IDN2 support.
>> I have to agree IDN2 does filter underscores out.
>> On Fedora 25:
>> $ idn2 --version
>> idn2 (libidn2) 2.0.2
>> $ idn2 -l _xmpp-server._tcp.domain.com
>> Not even transitional mode helps
>> $ idn2 -T _xmpp-server._tcp.domain.com
>> But older IDN works fine
>> $ idn --version
>> idn (GNU Libidn) 1.33
>> $ idn _xmpp-server._tcp.domain.com
>> I will have have to ask why would it do that.
>> Another question is whether SRV records should be formatted by libidn2
>> when they will not be displayed to the user. I think it should affect
>> only logs but not served names themselves.
>> Dne 6.7.2017 v 22:51 Matthias Andree napsal(a):
>>> with the release of v2.77, I have switched the FreeBSD port from IDN
>>> (which was used up to and including 2.76) to IDN2, and have just
>>> received a bug report where SRV records that use underscores are no
>>> longer recognized, and the reporter states that disabling the IDN2
>>> option reinstates the expected operation:
>>> Could you check that?
>>> It appears we're using libidn2 v2.0.2 in FreeBSD, and previously used
>>> libidn 1.33.
>>> Best regards,
>>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss mailing list
> Dnsmasq-discuss mailing list
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com PGP: 65C6C973
diff --git a/src/util.c b/src/util.c
index 76ee7f4..6af65f2 100644
@@ -201,9 +201,11 @@ char *canonicalise(char *in, int *nomem)
#if defined(HAVE_IDN) || defined(HAVE_LIBIDN2)
- /* libidn2 strips underscores, so don't do IDN processing
+#if !defined(IDN2_VERSION_NUMBER) || IDN2_VERSION_NUMBER < 0x02000003
+ /* older libidn2 strips underscores, so don't do IDN processing
if the name has an underscore (check_name() returned 2) */
if (rc != 2)
rc = idn2_to_ascii_lz(in, &ret, IDN2_NONTRANSITIONAL);
Dnsmasq-discuss mailing list