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:57 +0200 |
commit | 21a497cc58df2b9b02dc687b97f105335e7a1c50 (patch) | |
tree | 30c5a5180ce891b19fc8820b24727f466dde86c3 /resolv/res_mkquery.c | |
parent | b165c65c35d0fc4d60d63ae101f4edfa21c0d30b (diff) | |
download | glibc-21a497cc58df2b9b02dc687b97f105335e7a1c50.tar.gz glibc-21a497cc58df2b9b02dc687b97f105335e7a1c50.tar.xz glibc-21a497cc58df2b9b02dc687b97f105335e7a1c50.zip |
resolv: Move res_mkquery, res_nmkquery into libc
This switches to public symbols without __ prefixes, due to improved namespace management in glibc. The symbols res_mkquery, __res_mkquery, __res_nmkquery were moved with the script (using --no-new-version). res_mkquery@@GLIBC_2.34, res_nmkquery@@GLIBC_2.34 were added using make update-all-abi. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'resolv/res_mkquery.c')
-rw-r--r-- | resolv/res_mkquery.c | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/resolv/res_mkquery.c b/resolv/res_mkquery.c index 07c34d1340..ba6c983b58 100644 --- a/resolv/res_mkquery.c +++ b/resolv/res_mkquery.c @@ -141,9 +141,9 @@ __res_context_mkquery (struct resolv_context *ctx, int op, const char *dname, if ((buflen -= QFIXEDSZ) < 0) return -1; compose: - n = ns_name_compress (dname, cp, buflen, - (const unsigned char **) dnptrs, - (const unsigned char **) lastdnptr); + n = __ns_name_compress (dname, cp, buflen, + (const unsigned char **) dnptrs, + (const unsigned char **) lastdnptr); if (n < 0) return -1; cp += n; @@ -155,9 +155,9 @@ __res_context_mkquery (struct resolv_context *ctx, int op, const char *dname, break; /* Make an additional record for completion domain. */ - n = ns_name_compress ((char *)data, cp, buflen, - (const unsigned char **) dnptrs, - (const unsigned char **) lastdnptr); + n = __ns_name_compress ((char *)data, cp, buflen, + (const unsigned char **) dnptrs, + (const unsigned char **) lastdnptr); if (__glibc_unlikely (n < 0)) return -1; cp += n; @@ -174,6 +174,7 @@ __res_context_mkquery (struct resolv_context *ctx, int op, const char *dname, } return cp - buf; } +libc_hidden_def (__res_context_mkquery) /* Common part of res_nmkquery and res_mkquery. */ static int @@ -203,27 +204,38 @@ context_mkquery_common (struct resolv_context *ctx, DATALEN and NEWRR_IN are currently ignored. */ int -res_nmkquery (res_state statp, int op, const char *dname, - int class, int type, - const unsigned char *data, int datalen, - const unsigned char *newrr_in, - unsigned char *buf, int buflen) +___res_nmkquery (res_state statp, int op, const char *dname, + int class, int type, + const unsigned char *data, int datalen, + const unsigned char *newrr_in, + unsigned char *buf, int buflen) { return context_mkquery_common (__resolv_context_get_override (statp), op, dname, class, type, data, buf, buflen); } +versioned_symbol (libc, ___res_nmkquery, res_nmkquery, GLIBC_2_34); +#if OTHER_SHLIB_COMPAT (libresolv, GLIBC_2_2, GLIBC_2_34) +compat_symbol (libresolv, ___res_nmkquery, __res_nmkquery, GLIBC_2_2); +#endif int -res_mkquery (int op, const char *dname, int class, int type, - const unsigned char *data, int datalen, - const unsigned char *newrr_in, - unsigned char *buf, int buflen) +___res_mkquery (int op, const char *dname, int class, int type, + const unsigned char *data, int datalen, + const unsigned char *newrr_in, + unsigned char *buf, int buflen) { return context_mkquery_common (__resolv_context_get_preinit (), op, dname, class, type, data, buf, buflen); } +versioned_symbol (libc, ___res_mkquery, res_mkquery, GLIBC_2_34); +#if OTHER_SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2) +compat_symbol (libresolv, ___res_mkquery, res_mkquery, GLIBC_2_0); +#endif +#if OTHER_SHLIB_COMPAT (libresolv, GLIBC_2_2, GLIBC_2_34) +compat_symbol (libresolv, ___res_mkquery, __res_mkquery, GLIBC_2_2); +#endif /* Create an OPT resource record. Return the length of the final packet, or -1 on error. @@ -285,8 +297,4 @@ __res_nopt (struct resolv_context *ctx, return cp - buf; } - -#if SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2) -# undef res_mkquery -weak_alias (__res_mkquery, res_mkquery); -#endif +libc_hidden_def (__res_nopt) |