Regression in libbind's resolver initialization

Mark Andrews Mark_Andrews at isc.org
Fri Jun 29 02:50:41 UTC 2007


> Hi all,
> 
> looks that
> 
> 2119.   [compat]        libbind: allow res_init() to succeed enough to
>                         return the default domain even if it was unable
>                         to allocate memory.

Index: resolv/res_init.c
===================================================================
RCS file: /proj/cvs/prod/bind9/lib/bind/resolv/res_init.c,v
retrieving revision 1.22
diff -u -r1.22 res_init.c
--- resolv/res_init.c	11 Dec 2006 04:35:39 -0000	1.22
+++ resolv/res_init.c	29 Jun 2007 02:50:20 -0000
@@ -168,7 +168,7 @@
 	union res_sockaddr_union u[2];
 	int maxns = MAXNS;
 
-	h_errno = 0;
+	RES_SET_H_ERRNO(statp, 0);
 	if (statp->_u._ext.ext != NULL)
 		res_ndestroy(statp);
 
@@ -231,7 +231,7 @@
 		 * to check our return code wont be able to make
 		 * queries anyhow.
 		 */
-		h_errno = statp->res_h_errno = NETDB_INTERNAL;
+		RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
 		maxns = 0;
 	}
 #ifdef RESOLVSORT
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: Mark_Andrews at isc.org


More information about the bind-workers mailing list