]> granicus.if.org Git - libevent/commit
evdns: accept domains up to 254 long (previosly only 63 long was accepted)
authorAzat Khuzhin <azat@libevent.org>
Sun, 10 Jul 2022 14:33:15 +0000 (17:33 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sun, 10 Jul 2022 15:10:35 +0000 (18:10 +0300)
commit5ff98dc1f327d811cb76ceb88d35f5efd1384dfd
tree7927ad12f85a80488430c28fd63e3575d12aa89c
parent1933f6aaddd190167b180da7138a5df4c51517bb
evdns: accept domains up to 254 long (previosly only 63 long was accepted)

Previously evdns was using HOST_NAME_MAX, and define it to 255 *only* if
it not set, however it does set on linux:

    $ egrep -r define.*HOST_NAME_MAX /usr/include/bits
    /usr/include/bits/local_lim.h:#define HOST_NAME_MAX             64
    /usr/include/bits/posix1_lim.h:#define _POSIX_HOST_NAME_MAX     255
    /usr/include/bits/confname.h:#define _SC_HOST_NAME_MAX          _SC_HOST_NAME_MAX

But 64 should be the limit of the host component, not for the whole
hostname, as also noted by @ploxiln

So use our own EVDNS_NAME_MAX const, which is set to 255.

Fixes: #1280
evdns.c
test/regress_dns.c