mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 12:30:06 +00:00
resolv: Track single-request fallback via _res._flags (bug 31476)
This avoids changing _res.options, which inteferes with change detection as part of automatic reloading of /etc/resolv.conf. Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
parent
29807a271e
commit
868ab8923a
@ -947,9 +947,11 @@ send_dg(res_state statp,
|
|||||||
seconds /= statp->nscount;
|
seconds /= statp->nscount;
|
||||||
if (seconds <= 0)
|
if (seconds <= 0)
|
||||||
seconds = 1;
|
seconds = 1;
|
||||||
bool single_request_reopen = (statp->options & RES_SNGLKUPREOP) != 0;
|
bool single_request_reopen = ((statp->options & RES_SNGLKUPREOP)
|
||||||
bool single_request = (((statp->options & RES_SNGLKUP) != 0)
|
|| (statp->_flags & RES_F_SNGLKUPREOP));
|
||||||
| single_request_reopen);
|
bool single_request = ((statp->options & RES_SNGLKUP)
|
||||||
|
|| (statp->_flags & RES_F_SNGLKUP)
|
||||||
|
|| single_request_reopen);
|
||||||
int save_gotsomewhere = *gotsomewhere;
|
int save_gotsomewhere = *gotsomewhere;
|
||||||
|
|
||||||
int retval;
|
int retval;
|
||||||
@ -1006,14 +1008,14 @@ send_dg(res_state statp,
|
|||||||
have received the first answer. */
|
have received the first answer. */
|
||||||
if (!single_request)
|
if (!single_request)
|
||||||
{
|
{
|
||||||
statp->options |= RES_SNGLKUP;
|
statp->_flags |= RES_F_SNGLKUP;
|
||||||
single_request = true;
|
single_request = true;
|
||||||
*gotsomewhere = save_gotsomewhere;
|
*gotsomewhere = save_gotsomewhere;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
else if (!single_request_reopen)
|
else if (!single_request_reopen)
|
||||||
{
|
{
|
||||||
statp->options |= RES_SNGLKUPREOP;
|
statp->_flags |= RES_F_SNGLKUPREOP;
|
||||||
single_request_reopen = true;
|
single_request_reopen = true;
|
||||||
*gotsomewhere = save_gotsomewhere;
|
*gotsomewhere = save_gotsomewhere;
|
||||||
__res_iclose (statp, false);
|
__res_iclose (statp, false);
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#define RES_F_VC 0x00000001 /* Socket is TCP. */
|
#define RES_F_VC 0x00000001 /* Socket is TCP. */
|
||||||
#define RES_F_CONN 0x00000002 /* Socket is connected. */
|
#define RES_F_CONN 0x00000002 /* Socket is connected. */
|
||||||
#define RES_F_EDNS0ERR 0x00000004 /* EDNS0 caused errors. */
|
#define RES_F_EDNS0ERR 0x00000004 /* EDNS0 caused errors. */
|
||||||
|
#define RES_F_SNGLKUP 0x00200000 /* Private version of RES_SNGLKUP. */
|
||||||
|
#define RES_F_SNGLKUPREOP 0x00400000 /* Private version of RES_SNGLKUPREOP. */
|
||||||
|
|
||||||
/* The structure HEADER is normally aligned on a word boundary. In
|
/* The structure HEADER is normally aligned on a word boundary. In
|
||||||
some code, we need to access this structure when it may be aligned
|
some code, we need to access this structure when it may be aligned
|
||||||
|
Loading…
Reference in New Issue
Block a user