Skip to content

musl libc does not support lower level libresolv API (_res) #333

@thommey

Description

@thommey

musl does not support _res.nscount and _res.nslist at all - only the higher level API for sending out queries, which breaks dns.mod completely.

See https://git.musl-libc.org/cgit/musl/tree/src/network/res_state.c and related, and http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc#Name_Resolver_.2F_DNS for their reasoning.
Also, http://lists.busybox.net/pipermail/busybox/2014-November/081960.html

(partially relevant:
gliderlabs/docker-alpine#8
http://www.openwall.com/lists/musl/2015/09/04/4
http://www.openwall.com/lists/musl/2014/04/30/7
http://www.openwall.com/lists/musl/2014/05/04/20
http://www.openwall.com/lists/musl/2014/06/01/2
)

I would suggest detecting _res being all 0 after res_init() (not just _res.nscount, that can be normal) at dns.mod's configure and disabling dns.mod in that case - it completely relies on libresolv for detecting nameservers, building the query packet, etc.

found by geo (for reference)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions