about summary refs log tree commit diff
path: root/resolv/res_send.c
diff options
context:
space:
mode:
Diffstat (limited to 'resolv/res_send.c')
-rw-r--r--resolv/res_send.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 887d048e19..f38c399ffd 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -986,6 +986,24 @@ send_dg(res_state statp,
 				ans, (resplen > anssiz) ? anssiz : resplen);
 			goto wait;
 		}
+#ifdef RES_USE_EDNS0
+		if (anhp->rcode == FORMERR
+		    && (statp->options & RES_USE_EDNS0) != 0U) {
+			/*
+			 * Do not retry if the server do not understand
+			 * EDNS0.  The case has to be captured here, as
+			 * FORMERR packet do not carry query section, hence
+			 * res_queriesmatch() returns 0.
+			 */
+			DprintQ(statp->options & RES_DEBUG,
+				(stdout,
+				 "server rejected query with EDNS0:\n"),
+				ans, (resplen > anssiz) ? anssiz : resplen);
+			/* record the error */
+			statp->_flags |= RES_F_EDNS0ERR;
+			goto err_out;
+        }
+#endif
 		if (!(statp->options & RES_INSECURE2) &&
 		    !res_queriesmatch(buf, buf + buflen,
 				      ans, ans + anssiz)) {