-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glibc: getaddrinfo only returns ipv4 address for localhost even if ipv6 is enabled #19148
Comments
There is also no |
On Ubuntu 14.04.4 LTS, compiling your code with nix's gcc:
The machine has those entries in |
FWIW neither adding |
The same issue can be demonstrated with |
Found the issue: The difference is in the file
NixOS doesn't use a non-default From
|
@ben0x539 Should be a easy fix then right? |
Following other popular distros is probably the way to go, perhaps with a config option to opt out. |
this allows to return ipv4/ipv6 addresses for the same host in /etc/hosts. fixes NixOS#19148
Issue description
When localhost is mapped to both
127.0.0.1
and::1
in/etc/hosts
, getaddrinfo(3) still only returns127.0.0.1
. It should be returning both with ipv6 first.Steps to reproduce
Run the following program as
./a.out localhost
On gentoo, OSX and arch the program returns something like:
Whereas on nixos, it returns:
Technical details
nixos-version
, Ubuntu/Fedora:lsb_release -a
, ...) 17.03.git.792d277 (Gorilla)nix-env --version
) nix-env (Nix) 1.11.4nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
) 17.03.git.792d277The text was updated successfully, but these errors were encountered: