summaryrefslogtreecommitdiffstats
path: root/lib/libc/resolv/res_query.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2008-12-14 19:39:53 +0000
committerume <ume@FreeBSD.org>2008-12-14 19:39:53 +0000
commit5981f7a689e7291656f30b6c8e94a05339c101b0 (patch)
tree5e14eb7d469e63a149e56aedf1a74b40e820e7cd /lib/libc/resolv/res_query.c
parentd6c5fd3f81862801cb66bf464744657a24a2d4e2 (diff)
downloadFreeBSD-src-5981f7a689e7291656f30b6c8e94a05339c101b0.zip
FreeBSD-src-5981f7a689e7291656f30b6c8e94a05339c101b0.tar.gz
Merge the resolver part of BIND 9.4.3 into HEAD.
It includes the following fix: 2426. [bug] libbind: inet_net_pton() can sometimes return the wrong value if excessively large netmasks are supplied. [RT #18512] Reported by: Maksymilian Arciemowicz <cxib__at__securityreason.com>
Diffstat (limited to 'lib/libc/resolv/res_query.c')
-rw-r--r--lib/libc/resolv/res_query.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/libc/resolv/res_query.c b/lib/libc/resolv/res_query.c
index 3813291..746a2be 100644
--- a/lib/libc/resolv/res_query.c
+++ b/lib/libc/resolv/res_query.c
@@ -66,7 +66,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_query.c,v 1.7.18.1 2005/04/27 05:01:11 sra Exp $";
+static const char rcsid[] = "$Id: res_query.c,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -115,8 +115,9 @@ res_nquery(res_state statp,
{
u_char buf[MAXPACKET];
HEADER *hp = (HEADER *) answer;
- int n;
u_int oflags;
+ u_char *rdata;
+ int n;
oflags = statp->_flags;
@@ -131,8 +132,14 @@ again:
buf, sizeof(buf));
#ifdef RES_USE_EDNS0
if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
- (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U)
+ (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) {
n = res_nopt(statp, n, buf, sizeof(buf), anslen);
+ rdata = &buf[n];
+ if (n > 0 && (statp->options & RES_NSID) != 0U) {
+ n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata,
+ NS_OPT_NSID, 0, NULL);
+ }
+ }
#endif
if (n <= 0) {
#ifdef DEBUG
@@ -142,6 +149,7 @@ again:
RES_SET_H_ERRNO(statp, NO_RECOVERY);
return (n);
}
+
n = res_nsend(statp, buf, n, answer, anslen);
if (n < 0) {
#ifdef RES_USE_EDNS0
OpenPOWER on IntegriCloud