(send_dg): If request failed with FORMERR and EDNS0 record was send
authordrepper <drepper>
Fri, 9 Feb 2007 23:45:12 +0000 (23:45 +0000)
committerdrepper <drepper>
Fri, 9 Feb 2007 23:45:12 +0000 (23:45 +0000)
make sure we don't try it again.

resolv/res_send.c

index 887d048..f38c399 100644 (file)
@@ -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)) {