In message <[email protected]>, Florian Weimer writes: > * Mark Andrews: > > > getaddrinfo was designed to extended. It wouldn't be hard to add ttl > > information to getaddrinfo, just add a ai_ttl to the structure at the > > end and define a flag to say whether it is valid. > > struct addrinfo cannot be extended in this way because its size is > part of the ABI, and callers are even encouraged to allocate struct > addrinfo objects to pass the hints.
And that is something that can be dealt with by setting a flag bit when calling getaddrinfo. As I stated getaddrinfo is designed to be extended. > I've already found one Debian package which embeds a struct addrinfo > field in the middle of a struct defined in a header file (the shishi > Kerberos implementation). Unfortunately, changing struct addrinfo in > the way you propose has an extremely high risk of breaking > applications. > > It is possible to extend getaddrinfo without change the size of struct > addrinfo, but this will require accessor functions for the new fields. Which itself would not be a bad thing. Calling a function to get the data is only slightly more expensive than directly reading a structure element. -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: [email protected] _______________________________________________ dns-operations mailing list [email protected] https://lists.dns-oarc.net/mailman/listinfo/dns-operations dns-jobs mailing list https://lists.dns-oarc.net/mailman/listinfo/dns-jobs
