Skip to content

Musl's getaddrinfo cannot resolve peer names from Netbird's client DNS #2098

Open
@glaeqen

Description

@glaeqen

Describe the problem

Programs linked against muslc cannot resolve the peer name against a DNS provided by Netbird client . getaddrinfo with default addrinfo returns EAI_NONAME.

Musl's getaddrinfo with default settings (specifically addrinfo.af_family == AF_UNSPEC) asks for both A and AAAA entry. If any response contains a flag "No such name", error EAI_NONAME is returned. This behaviour is different in glibc. Relevant mailing list: https://www.openwall.com/lists/musl/2021/07/19/8

To Reproduce

Steps to reproduce the behavior:
0. Connect to a netbird network.

  1. $ docker run --network host -it alpine
  2. In a container: $ ping <valid-peer-domain-name>
  3. Failure occurs

You can also see that choosing to resolve only IPv4 works
$ ping -4 <valid-peer-name

Expected behavior

Proper peer name resolution. Not sure what Netbird's DNS should do but DNSes for example for github.com seem to respond with an empty response but a flag is "No error" instead of "No such name"? Not sure.

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions