1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

resolv: Introduce struct resolv_conf with extended resolver state

This change provides additional resolver configuration state which
is not exposed through the _res ABI.  It reuses the existing
initstamp field in the supposedly-private part of _res.  Some effort
is undertaken to avoid memory safety issues introduced by applications
which directly patch the _res object.

With this commit, only the initstamp field is moved into struct
resolv_conf.  Additional members will be added later, eventually
migrating the entire resolver configuration.
This commit is contained in:
Florian Weimer
2017-07-03 20:31:23 +02:00
parent 352f4ff9a2
commit f30a54b21b
9 changed files with 470 additions and 10 deletions

View File

@ -47,10 +47,10 @@ struct __res_state {
uint16_t nsinit;
struct sockaddr_in6 *nsaddrs[MAXNS];
#ifdef _LIBC
unsigned long long int initstamp
unsigned long long int __glibc_extension_index
__attribute__((packed));
#else
unsigned int _initstamp[2];
unsigned int __glibc_reserved[2];
#endif
} _ext;
} _u;