diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-07-19 07:55:27 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-07-19 07:56:21 +0200 |
commit | 640bbdf71c6f10ac26252ac67a22902e26657bd8 (patch) | |
tree | 227d6260dda188bdc22f2d9a6b52acd77c3d68b7 /resolv/res_comp.c | |
parent | 13e1f86706e463de4429f7e88f47c6ff65cd845e (diff) | |
download | glibc-640bbdf71c6f10ac26252ac67a22902e26657bd8.zip glibc-640bbdf71c6f10ac26252ac67a22902e26657bd8.tar.gz glibc-640bbdf71c6f10ac26252ac67a22902e26657bd8.tar.bz2 |
resolv: Move dn_expand to its own file and into libc
And reformat to GNU style.
This switches back to the dn_expand name for the ABI symbol and turns
__dn_expand into a compatibility symbol. With the improved namespace
management in current glibc, it is no longer necessary to use a
private namespace symbol. To avoid old code binding to a
GLIBC_PRIVATE symbol by accident, use __libc_dn_expand for the
internal symbol name.
The symbols dn_expand, __dnexpand were moved using
scripts/move-symbol-to-libc.py, followed by an adjustment to make
dn_expand the only GLIBC_2.34 symbol.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'resolv/res_comp.c')
-rw-r--r-- | resolv/res_comp.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/resolv/res_comp.c b/resolv/res_comp.c index c537886..42e73a1 100644 --- a/resolv/res_comp.c +++ b/resolv/res_comp.c @@ -93,25 +93,6 @@ #include <unistd.h> /* - * Expand compressed domain name 'comp_dn' to full domain name. - * 'msg' is a pointer to the beginning of the message, - * 'eomorig' points to the first location after the message, - * 'exp_dn' is a pointer to a buffer of size 'length' for the result. - * Return size of compressed name or -1 if there was an error. - */ -int -dn_expand(const u_char *msg, const u_char *eom, const u_char *src, - char *dst, int dstsiz) -{ - int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz); - - if (n > 0 && dst[0] == '.') - dst[0] = '\0'; - return (n); -} -libresolv_hidden_def (dn_expand) - -/* * Pack domain name 'exp_dn' in presentation form into 'comp_dn'. * Return the size of the compressed name or -1. * 'length' is the size of the array pointed to by 'comp_dn'. @@ -268,11 +249,3 @@ void __putshort(uint16_t src, u_char *dst) { ns_put16(src, dst); } libresolv_hidden_def (__putshort) uint32_t _getlong(const u_char *src) { return (ns_get32(src)); } uint16_t _getshort(const u_char *src) { return (ns_get16(src)); } - - -#include <shlib-compat.h> - -#if SHLIB_COMPAT(libresolv, GLIBC_2_0, GLIBC_2_2) -# undef dn_expand -weak_alias (__dn_expand, dn_expand); -#endif |