[Dnsmasq-discuss] [PATCH] IDN parameter enablement & domain_len optimization

Petr Menšík pemensik at redhat.com
Thu Sep 30 21:16:19 UTC 2021


Hi,

I am submitting patch enabling IDN usage for input parameters. We have
support for IDN, but because locale is not properly initialized, no
parameters using special characters are accepted.

Patch #1 adds domain_len to more places, quite similar to struct server
and struct serv_local. It computes length of saved domain only once and
uses it on various processing. Just small optimization on not critical
bits, since main lookup_domain already uses it. I think it should be
used on more places.

I think we could define someting like struct binstring { char *str, u16
len }; and use it more in code. Pairs of string and its length are
common and handled different way. Because just basic char * is used on
many places, strlen is called again and again, often not required.
Especially might be useful for DHCP binary strings processing.

Patch #2 enables --address=/münchen.de/háčkyčárky.cz/ on input even on
builds without defined LOCALEDIR. Which is missing on Fedora and it
seems IDN support is effectively inactive that way. Adds --auth-zone
support for IDN too.

Patch #3 disables IDN_TRANSITIONAL mode. I wanted to try some refused
IDN name, but transitional mode accepts almost any character. It accepts
also --address=/💻🚱.test/. I think there is no need to support such
obscure names, but we should accept normal names supported by browsers.
Since I think IDN 2003 support were not properly enabled before, I think
we should start just from IDN 2008 standard.

I think there is still something weird, because --address=/испытание./
is accepted but --address=/испытание/ is not. Improvement anyway.

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemensik at redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Disable-transitional-IDN-rules-accept-only-sane-name.patch
Type: text/x-patch
Size: 1160 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20210930/d35c192c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Enable-locale-support-for-IDN-at-startup.patch
Type: text/x-patch
Size: 1354 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20210930/d35c192c/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-domain_len-to-domain-parameters-in-several-struc.patch
Type: text/x-patch
Size: 7223 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20210930/d35c192c/attachment-0002.bin>


More information about the Dnsmasq-discuss mailing list