public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Glenn Golden <gdg@zplane.com>
Cc: libc-help@sourceware.org
Subject: Re: getent ahostsv4 seems to interact with network interface addressing
Date: Sun, 05 Nov 2023 21:10:50 +0100	[thread overview]
Message-ID: <875y2ggdv9.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <ZUZF7JMvAILKhosE@huh.zplane.com> (Glenn Golden's message of "Sat, 4 Nov 2023 07:23:56 -0600")

* Glenn Golden:

> System:
>   Arch linux, glibc 2.38-7, kernel 6.1.59-1, commodity i686 laptop.
>
> Description of issue:
>   Not sure if this is a bug or just a misunderstanding on my part as to how
>   getent ought to be behaving when attempting lookups using the ahostsv4
>   database, expecting it to query and return results from /etc/hosts.
>
>   The behavior of "getent ahostsv4 HOSTNAME" seems to strangely depend on
>   whether there are any network interfaces presently having an assigned v4
>   address, as demonstrated in detail in "Steps to reproduce" below.

By default, getent uses AI_ADDRCONFIG under the covers, and what you
see is the expected behavior of that getaddrinfo option.  Recent glibc
versions have a getent option that switches of AI_ADDRCONFIG:

  -A, --no-addrconfig        do not filter out unsupported IPv4/IPv6 addresses
                             (with ahosts*)

  reply	other threads:[~2023-11-05 20:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-04 13:23 Glenn Golden
2023-11-05 20:10 ` Florian Weimer [this message]
2023-11-06  0:43   ` Glenn Golden
2023-11-06  5:58     ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y2ggdv9.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=gdg@zplane.com \
    --cc=libc-help@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).