public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: David Howells <dhowells@redhat.com>,
	 jlayton@redhat.com,  libc-alpha@sourceware.org
Subject: Re: Can getaddrinfo() be extended to return the record TTL
Date: Wed, 07 Aug 2019 13:35:00 -0000	[thread overview]
Message-ID: <875zn9gktr.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <20190806151632.u454tetx762wrgzs@dcvr> (Eric Wong's message of "Tue, 6 Aug 2019 15:16:32 +0000")

* Eric Wong:

> Florian Weimer <fweimer@redhat.com> wrote:
>> * David Howells:
>> > If it's not possible to extend getaddrinfo() in this way, would it be possible
>> > to provide a getaddrinfo2() that returns this information through an
>> > additional parameter?
>> 
>> That definitely would be a new ABI.
>> 
>> New ABIs have a lead time of around three years before productization.
>> Is this something you could work with?
>
> Fwiw, gaicb has an "int __glibc_reserved[5]" field; so it's
> probably possible to extend the already-glibc-specific getaddrinfo_a(3)
> to return the TTL.
>
> I was looking into getting the TTL the other week for something
> else, but settled on using a dedicated thread to call
> getaddrinfo(3) every few seconds and publishing updates to other
> threads via URCU.

You could perform the request directly over DNS and if you get back the
same addresses as via getaddrinfo, you can use the TTL you see on DNS.

It's not really nice as far as a programming interface goes, but it
should give you accurate TTL information in most cases.

Thanks,
Florian

  reply	other threads:[~2019-08-07 13:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 16:42 David Howells
2019-08-02 17:21 ` Florian Weimer
2019-08-06 15:16   ` Eric Wong
2019-08-07 13:35     ` Florian Weimer [this message]
2019-08-02 19:33 ` David Howells
2019-08-02 21:47   ` Carlos O'Donell
2020-04-14 14:15     ` Jeff Layton
2019-08-07 13:32   ` Florian Weimer
2020-04-14 13:42   ` David Howells

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=875zn9gktr.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=normalperson@yhbt.net \
    /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).