Can getaddrinfo() be extended to return the record TTL

David Howells dhowells@redhat.com
Tue Apr 14 13:42:53 GMT 2020


Florian Weimer <fweimer@redhat.com> wrote:

> > Florian Weimer <fweimer@redhat.com> wrote:
> >
> >> > The userspace side of the upcall *should* be setting the expiry time
> >> > on the record - but it can't as the C library doesn't give us that
> >> > (and, indeed, it's not available from all sources).
> >> 
> >> Is this merely a correctness thing, or does this enable some
> >> user-visible functionality?
> >
> > The kernel's DNS cache's ordinary records currently don't have their expiry
> > set as I don't have anything to set it to - with the result that the entries
> > in the cache never expire and have to be manually invalidated if you want them
> > to be reread.
> >
> > I can, and probably should, set the default timeout to something reasonably
> > small and finite (say 10 mins) in the absence of such data, but it would be
> > better, I think, to set the TTL from the record (if available).
> >
> > So, yes, this is actually causing a problem.
> 
> I actually meant whether it enables some user-visible functionality,
> like failover or service migration.
> 
> It's tricky to make this work in practice using DNS even if you know the
> TTL, which is why I'm asking. 8-)

Ah, sorry, I never got around to replying.  The problem is that the address
mapping records in the kernel used by a variety of network filesystems (NFS,
AFS, CIFS, etc.) don't expire because I don't expire because I don't have any
expiration information to apply.

David



More information about the Libc-alpha mailing list