glibc/glibc-rh168253-res_isourserver-reorg.patch
Florian Weimer 8597553f96 Rebase DNS stub resolver to the glibc 2.26 version
- Support an arbitrary number of search domains (#168253)
- Detect and apply /etc/resolv.conf changes in libresolv (#1374239)
- CVE-2015-5180: DNS stub resolver crash with crafted record type (#1251403)
2017-10-11 14:41:27 +02:00

67 lines
1.8 KiB
Diff

commit ded603542a8af41dc0c45af883d52390683f63aa
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Jun 30 11:31:47 2017 +0200
resolv: Move res_isourserver, res_send from res_data.c to res_send.c
diff --git a/resolv/res_data.c b/resolv/res_data.c
index d05389e1347a57ab..b790b4b725bc9edd 100644
--- a/resolv/res_data.c
+++ b/resolv/res_data.c
@@ -45,22 +45,6 @@ res_query(const char *name, /* domain name */
return (res_nquery(&_res, name, class, type, answer, anslen));
}
-int
-res_isourserver(const struct sockaddr_in *inp) {
- return (res_ourserver_p(&_res, (const struct sockaddr_in6 *) inp));
-}
-
-int
-res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) {
- if (__res_maybe_init (&_res, 1) == -1) {
- /* errno should have been set by res_init() in this case. */
- return (-1);
- }
-
- return (res_nsend(&_res, buf, buflen, ans, anssiz));
-}
-
-
void
res_close(void) {
/*
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 18308709542da6e6..2e0b6c226105400a 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -244,6 +244,12 @@ res_ourserver_p(const res_state statp, const struct sockaddr_in6 *inp)
return (0);
}
+int
+res_isourserver (const struct sockaddr_in *inp)
+{
+ return res_ourserver_p (&_res, (const struct sockaddr_in6 *) inp);
+}
+
/* int
* res_nameinquery(name, type, class, buf, eom)
* look for (name,type,class) in the query section of packet (buf,eom)
@@ -545,6 +551,15 @@ res_nsend(res_state statp,
}
libresolv_hidden_def (res_nsend)
+int
+res_send (const unsigned char *buf, int buflen, unsigned char *ans, int anssiz)
+{
+ if (__res_maybe_init (&_res, 1) == -1)
+ /* errno should have been set by res_init in this case. */
+ return -1;
+ return res_nsend (&_res, buf, buflen, ans, anssiz);
+}
+
/* Private */
static struct sockaddr *