about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--resolv/res_send.c12
-rw-r--r--resolv/resolv-internal.h2
3 files changed, 10 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 9f95df7ae1..ad2d2dd25a 100644
--- a/NEWS
+++ b/NEWS
@@ -93,6 +93,7 @@ The following bugs are resolved with this release:
   [30804] F_GETLK, F_SETLK, and F_SETLKW value change for powerpc64 with
     -D_FILE_OFFSET_BITS=64
   [30843] potential use-after-free in getcanonname (CVE-2023-4806)
+  [31476] resolv: Track single-request fallback via _res._flags
   [31184] FAIL: elf/tst-tlsgap
   [31185] Incorrect thread point access in _dl_tlsdesc_undefweak and _dl_tlsdesc_dynamic
   [31890] resolv: Allow short error responses to match any DNS query
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 12fd926372..6bd27b8620 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -942,9 +942,11 @@ send_dg(res_state statp,
 		seconds /= statp->nscount;
 	if (seconds <= 0)
 		seconds = 1;
-	bool single_request_reopen = (statp->options & RES_SNGLKUPREOP) != 0;
-	bool single_request = (((statp->options & RES_SNGLKUP) != 0)
-			       | single_request_reopen);
+	bool single_request_reopen = ((statp->options & RES_SNGLKUPREOP)
+				      || (statp->_flags & RES_F_SNGLKUPREOP));
+	bool single_request = ((statp->options & RES_SNGLKUP)
+			       || (statp->_flags & RES_F_SNGLKUP)
+			       || single_request_reopen);
 	int save_gotsomewhere = *gotsomewhere;
 
 	int retval;
@@ -1001,14 +1003,14 @@ send_dg(res_state statp,
 		       have received the first answer.  */
 		    if (!single_request)
 		      {
-			statp->options |= RES_SNGLKUP;
+			statp->_flags |= RES_F_SNGLKUP;
 			single_request = true;
 			*gotsomewhere = save_gotsomewhere;
 			goto retry;
 		      }
 		    else if (!single_request_reopen)
 		      {
-			statp->options |= RES_SNGLKUPREOP;
+			statp->_flags |= RES_F_SNGLKUPREOP;
 			single_request_reopen = true;
 			*gotsomewhere = save_gotsomewhere;
 			__res_iclose (statp, false);
diff --git a/resolv/resolv-internal.h b/resolv/resolv-internal.h
index 2fa57d394f..f259b5c9e5 100644
--- a/resolv/resolv-internal.h
+++ b/resolv/resolv-internal.h
@@ -26,6 +26,8 @@
 #define RES_F_VC        0x00000001 /* Socket is TCP.  */
 #define RES_F_CONN      0x00000002 /* Socket is connected.  */
 #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.  */
 
 /* Legacy function.  This needs to be removed once all NSS modules
    have been adjusted.  */