public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
@ 2021-05-17 11:13 JOSHI, RAHUL
  2021-05-17 11:16 ` Florian Weimer
  0 siblings, 1 reply; 10+ messages in thread
From: JOSHI, RAHUL @ 2021-05-17 11:13 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help, libc-alpha

Hi Weimer, we have changes ready in glibc to return TTL for resolved IP addresses in 'getaddrinfo'. Can you please let me know what is the procedure to raise a request with a patch??

Thanks,
Rahul

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
  2021-05-17 11:13 Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a' JOSHI, RAHUL
@ 2021-05-17 11:16 ` Florian Weimer
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Weimer @ 2021-05-17 11:16 UTC (permalink / raw)
  To: JOSHI, RAHUL; +Cc: libc-help, libc-alpha

* RAHUL JOSHI:

> Hi Weimer, we have changes ready in glibc to return TTL for resolved
> IP addresses in 'getaddrinfo'. Can you please let me know what is the
> procedure to raise a request with a patch??

The first step is to ensure that you have permission to post your work
publicly.  This something that you need to clarify with your employer.
Once that is done, you can post your patch.

It is likely that your patch will require FSF copyright assignment, as
described here:

<https://sourceware.org/glibc/wiki/Contribution%20checklist#FSF_copyright_assignment>

I do not have access to the FSF records and do not know if HPE already
has a copyright assignment on file.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
  2021-05-06  8:05     ` JOSHI, RAHUL
@ 2021-05-06  9:20       ` Florian Weimer
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Weimer @ 2021-05-06  9:20 UTC (permalink / raw)
  To: JOSHI, RAHUL; +Cc: libc-help, libc-alpha

* RAHUL JOSHI:

> Hi Weimer, is there any update on this??
>
> https://code.woboq.org/userspace/glibc/sysdeps/posix/getaddrinfo.c.html#1068 -> here we need to allocate memory for TTL and access it by accessor function??
>
> Thanks,
> Rahul

Probably, and maybe use some separate data structure to keep track of
struct addrinfo pointer values for which the TTL field is actually
available.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
       [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
  2 siblings, 1 reply; 10+ messages in thread
From: JOSHI, RAHUL @ 2021-05-06  8:05 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help, libc-alpha

Hi Weimer, is there any update on this??

https://code.woboq.org/userspace/glibc/sysdeps/posix/getaddrinfo.c.html#1068 -> here we need to allocate memory for TTL and access it by accessor function??

Thanks,
Rahul

-----Original Message-----
From: JOSHI, RAHUL 
Sent: Wednesday, May 05, 2021 5:57 PM
To: 'Florian Weimer' <fweimer@redhat.com>
Cc: 'libc-help@sourceware.org' <libc-help@sourceware.org>; 'libc-alpha@sourceware.org' <libc-alpha@sourceware.org>
Subject: RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'

Sorry Weimer I didn't get what you suggested previously, did you mean allocating memory for TTL after allocating result list??

Example :
If 2 addresses have been resolved, then the allocation for result should be

2 * sizeof(addrinfo) + 2 * allocate memory for TTL

Is my understanding correct??

Thanks,
Rahul

-----Original Message-----
From: JOSHI, RAHUL 
Sent: Wednesday, May 05, 2021 3:11 PM
To: 'Florian Weimer' <fweimer@redhat.com>
Cc: 'libc-help@sourceware.org' <libc-help@sourceware.org>; 'libc-alpha@sourceware.org' <libc-alpha@sourceware.org>
Subject: RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'



-----Original Message-----
From: JOSHI, RAHUL
Sent: Wednesday, May 05, 2021 2:26 PM
To: Florian Weimer <fweimer@redhat.com>
Subject: RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'

Thanks Weimer for the response, I did look into the glibc code and the TTL is already calculated(as minimum TTL value among list of resolved addresses) by some of the API but not accessed by 'getaddrinfo' (passed NULL as argument to TTL pointer). Is it better to modify existing getaddrinfo API or have a similar API to it??

And can I make changes to glibc and if yes, is there any reference or procedure to do that??

Thanks,
Rahul

-----Original Message-----
From: Florian Weimer [mailto:fweimer@redhat.com]
Sent: Wednesday, May 05, 2021 2:10 PM
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'

* 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
       [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
  2 siblings, 0 replies; 10+ messages in thread
From: JOSHI, RAHUL @ 2021-05-05 12:27 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help, libc-alpha

Sorry Weimer I didn't get what you suggested previously, did you mean allocating memory for TTL after allocating result list??

Example :
If 2 addresses have been resolved, then the allocation for result should be

2 * sizeof(addrinfo) + allocate memory for TTL

Is my understanding correct??

Thanks,
Rahul

-----Original Message-----
From: JOSHI, RAHUL 
Sent: Wednesday, May 05, 2021 3:11 PM
To: 'Florian Weimer' <fweimer@redhat.com>
Cc: 'libc-help@sourceware.org' <libc-help@sourceware.org>; 'libc-alpha@sourceware.org' <libc-alpha@sourceware.org>
Subject: RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'



-----Original Message-----
From: JOSHI, RAHUL
Sent: Wednesday, May 05, 2021 2:26 PM
To: Florian Weimer <fweimer@redhat.com>
Subject: RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'

Thanks Weimer for the response, I did look into the glibc code and the TTL is already calculated(as minimum TTL value among list of resolved addresses) by some of the API but not accessed by 'getaddrinfo' (passed NULL as argument to TTL pointer). Is it better to modify existing getaddrinfo API or have a similar API to it??

And can I make changes to glibc and if yes, is there any reference or procedure to do that??

Thanks,
Rahul

-----Original Message-----
From: Florian Weimer [mailto:fweimer@redhat.com]
Sent: Wednesday, May 05, 2021 2:10 PM
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'

* 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
       [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
  2 siblings, 0 replies; 10+ messages in thread
From: JOSHI, RAHUL @ 2021-05-05  9:41 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help, libc-alpha



-----Original Message-----
From: JOSHI, RAHUL 
Sent: Wednesday, May 05, 2021 2:26 PM
To: Florian Weimer <fweimer@redhat.com>
Subject: RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'

Thanks Weimer for the response, I did look into the glibc code and the TTL is already calculated(as minimum TTL value among list of resolved addresses) by some of the API but not accessed by 'getaddrinfo' (passed NULL as argument to TTL pointer). Is it better to modify existing getaddrinfo API or have a similar API to it??

And can I make changes to glibc and if yes, is there any reference or procedure to do that??

Thanks,
Rahul

-----Original Message-----
From: Florian Weimer [mailto:fweimer@redhat.com]
Sent: Wednesday, May 05, 2021 2:10 PM
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'

* 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
  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
       [not found]   ` <CS1PR8401MB050236FE63C077687BC1C1D7C0599@CS1PR8401MB0502.NAMPRD84.PROD.OUTLOOK.COM>
  2 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2021-05-05  8:39 UTC (permalink / raw)
  To: JOSHI, RAHUL via Libc-help; +Cc: JOSHI, RAHUL

* 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
  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
  2 siblings, 0 replies; 10+ messages in thread
From: JOSHI, RAHUL @ 2021-05-05  8:33 UTC (permalink / raw)
  To: libc-help, libc-alpha



From: JOSHI, RAHUL
Sent: Wednesday, May 05, 2021 1:57 PM
To: 'libc-help@sourceware.org' <libc-help@sourceware.org>
Subject: RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'

Hi all, is there any update on this??

Thanks,
Rahul

From: JOSHI, RAHUL
Sent: Monday, May 03, 2021 11:30 AM
To: libc-help@sourceware.org<mailto:libc-help@sourceware.org>
Subject: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'

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??

Thanks,
Rahul

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
  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
  2 siblings, 0 replies; 10+ messages in thread
From: JOSHI, RAHUL @ 2021-05-05  8:27 UTC (permalink / raw)
  To: libc-help

Hi all, is there any update on this??

Thanks,
Rahul

From: JOSHI, RAHUL
Sent: Monday, May 03, 2021 11:30 AM
To: libc-help@sourceware.org
Subject: Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'

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??

Thanks,
Rahul

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a'
@ 2021-05-03  5:59 JOSHI, RAHUL
  2021-05-05  8:27 ` JOSHI, RAHUL
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: JOSHI, RAHUL @ 2021-05-03  5:59 UTC (permalink / raw)
  To: libc-help

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??

Thanks,
Rahul

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-05-17 11:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 11:13 Having TTL of resolved IP addresses in 'getaddrinfo' or 'getaddrinfo_a' JOSHI, RAHUL
2021-05-17 11:16 ` Florian Weimer
  -- strict thread matches above, loose matches on Subject: below --
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
     [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

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).