From 640bbdf71c6f10ac26252ac67a22902e26657bd8 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 19 Jul 2021 07:55:27 +0200 Subject: 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 Tested-by: Carlos O'Donell --- resolv/res_comp.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'resolv/res_comp.c') 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 /* - * 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 - -#if SHLIB_COMPAT(libresolv, GLIBC_2_0, GLIBC_2_2) -# undef dn_expand -weak_alias (__dn_expand, dn_expand); -#endif -- cgit v1.1