Re:Musl 1.2.4 adds TCP DNS fallback
by geocar on Sunday July 30, 2023 @03:21PM
(#36934924)
Email servers cannot use gethostbyname anyway; they never would have been affected by this issue.
[ Parent
| on HN ]
I'm skeptical of that. Why do you say so?
gethostbyname() only returns an address, it can't be used to e.g. query for MX records. You also lose control over retries to different addresses if you use gethostbyname(), which some mail server software will also care about.
However as I noted in my other reply, musl also implements the res_* functions, like res_send() etc., and those can be used to address both.
It can't use gethostbyname() for looking up MX records, but plenty of mail related software have used it to look up A records.
However musl also includes res_send() etc., which can be used for MX records, and e.g. Qmail did use it back then. Here's the commit adding TCP support to those functions in Musl.
http://git.musl-libc.org/cgit/musl/commit/src/network/res_ms...
I wasn't aware musl implemented libres. I don't have a problem with libres doing TCP.
Qmail's issue was a hardcoded buffer size so this patch to musl wouldn't have helped.
The point wasn't that this would have helped Qmail - Musl didn't exist back then for that matter -, but that running into the 512 byte limit and needing TCP fallback was already a thing. Bumping a buffer size is far less effort than having to replace the resolver.