Skip to content

Commit

Permalink
* resolv/res_query.c (__libc_res_nquery): Issue debug message only
Browse files Browse the repository at this point in the history
	if DEBUG is defined.
  • Loading branch information
Ulrich Drepper committed Jul 9, 2008
1 parent 44abc39 commit fdc769f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2008-07-09 Ulrich Drepper <drepper@redhat.com>

* resolv/res_query.c (__libc_res_nquery): Issue debug message only
if DEBUG is defined.

* resolv/res_query.c (__libc_res_nquery): Align buffer for T_AAAA
query. Adjust buffer size computation for padding.

Expand Down
6 changes: 4 additions & 2 deletions resolv/res_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ __libc_res_nquery(res_state statp,
nquery1 = n;
/* Align the buffer. */
int npad = ((nquery1 + __alignof__ (HEADER) - 1)
& ~(__alignof__ (HEADER)));
& ~(__alignof__ (HEADER) - 1)) - nquery1;
if (n > bufsize - npad)
{
n = -1;
goto unspec_nomem;
}
query2 = buf + npad;
int nused = n + npad;
query2 = buf + nused;
n = res_nmkquery(statp, QUERY, name, class, T_AAAA, NULL, 0,
NULL, query2, bufsize - nused);
if (n > 0
Expand Down Expand Up @@ -204,8 +204,10 @@ __libc_res_nquery(res_state statp,
if ((statp->options & RES_USE_EDNS0) != 0
&& ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) {
statp->_flags |= RES_F_EDNS0ERR;
#ifdef DEBUG
if (statp->options & RES_DEBUG)
printf(";; res_nquery: retry without EDNS0\n");
#endif
goto again;
}
#ifdef DEBUG
Expand Down

0 comments on commit fdc769f

Please sign in to comment.