public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "JOSHI, RAHUL via Libc-help" <libc-help@sourceware.org>
Cc: "JOSHI, RAHUL" <rahulj@hpe.com>
Subject: Re: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
Date: Wed, 05 May 2021 10:39:35 +0200	[thread overview]
Message-ID: <87a6p9h8vs.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CS1PR8401MB0502958E8F2E90F0AC840759C05B9@CS1PR8401MB0502.NAMPRD84.PROD.OUTLOOK.COM> (RAHUL via Libc-help JOSHI's message of "Mon, 3 May 2021 05:59:56 +0000")

* RAHUL via Libc-help JOSHI:

> Hi all, in current implementation of 'getaddrinfo' or 'getaddrinfo_a'
> , the TTL(expiry time) of resolved IP addresses isn't provided. Is
> there any alternate API in libc which will provide resolved IP
> addresses along with TTL??
>
> If no, what needs to be done to get the resolved addresses along with
> TTL??

We can't put the TTL directly into struct addrinfo because we shouldn't
change its size.  We'd have to add an accessor function and change the
way getaddrinfo allocates the result list.  Fortunately, there is a
freeaddrinfo function, so we can maintain a data structure on the side
that keeps track of TTLs, for use by the accessor function.

It's not super-hard, but also not exactly trivial, either.  I'm not
aware of anyone working on this feature, but it is requested from time
to time, so it would be a nice addition to glibc.

Thanks,
Florian


  parent reply	other threads:[~2021-05-05  8:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03  5:59 JOSHI, RAHUL
2021-05-05  8:27 ` JOSHI, RAHUL
2021-05-05  8:33 ` JOSHI, RAHUL
2021-05-05  8:39 ` Florian Weimer [this message]
     [not found]   ` <CS1PR8401MB050236FE63C077687BC1C1D7C0599@CS1PR8401MB0502.NAMPRD84.PROD.OUTLOOK.COM>
2021-05-05  9:41     ` JOSHI, RAHUL
2021-05-05 12:27     ` JOSHI, RAHUL
2021-05-06  8:05     ` JOSHI, RAHUL
2021-05-06  9:20       ` Florian Weimer
2021-05-17 11:13 JOSHI, RAHUL
2021-05-17 11:16 ` 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=87a6p9h8vs.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    --cc=rahulj@hpe.com \
    /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).