[PATCH] nss: Use gethostbyname4_r when requesting IPv6 addresses (bug 14413)

Patrick Griffis pgriffis@igalia.com
Tue Oct 28 18:51:08 GMT 2025


On 2025-10-27 08:40, Carlos O'Donell wrote:
> Patrick,
> 
> This still fails pre-commit CI as noted by Adhemerval in an earlier post.
> 
> https://patchwork.sourceware.org/project/glibc/patch/20251025002359.2093627-1-pgriffis@igalia.com/
> 
> Have you had a chance to look into the regression?

Hi Carlos,

I have looked but unfortunately I don’t think it’s possible to fix this
bug and keep the exact same behavior for error codes.

Previously if you only request IPv6 addresses with gethostbyname3_r and
it has none it always errors with EAI_NONAME which makes sense as the
resolver doesn’t care about IPv4.

Since we need to use gethostbyname4_r the resolver does consider the
IPv4 results and may error with EAI_NODATA. This also makes sense, and
is closer to the truth, but it’s a behavior change.

Trying to emulate the previous behavior is tricky since both errors are
valid and we just don’t have enough information.

To me it sounds fine to change the one nss test to expect EAI_NONAME
instead.

The long term solution unfortunately is to make a gethostbyname5_r. I’ve
opened an issue[0] over this and would love input from any maintainers.

[0] https://sourceware.org/bugzilla/show_bug.cgi?id=33545

Regards,
Patrick


More information about the Libc-alpha mailing list