]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
make declaration and use of setnocookie fully conditional
authorMark Andrews <marka@isc.org>
Thu, 15 Feb 2018 01:36:03 +0000 (12:36 +1100)
committerMark Andrews <marka@isc.org>
Fri, 16 Feb 2018 03:08:26 +0000 (14:08 +1100)
lib/dns/resolver.c

index 8fb6dc9c6bb53b9b03b57196190733ec84c99f38..9075db70fe41ddcc29dd107782435bf964e31728 100644 (file)
@@ -9362,9 +9362,10 @@ rctx_badserver(respctx_t *rctx, isc_result_t result) {
                }
        } else if (fctx->rmessage->rcode == dns_rcode_badvers) {
                unsigned int version;
-               isc_boolean_t setnocookie = ISC_FALSE;
 #if DNS_EDNS_VERSION > 0
                unsigned int flags, mask;
+#else
+               isc_boolean_t setnocookie = ISC_FALSE;
 #endif
 
                /*
@@ -9376,8 +9377,10 @@ rctx_badserver(respctx_t *rctx, isc_result_t result) {
                 */
                if (dns_adb_getcookie(fctx->adb, query->addrinfo,
                                      cookie, sizeof(cookie)) == 0U) {
+#if DNS_EDNS_VERSION <= 0
                        if (!NOCOOKIE(query->addrinfo))
                                setnocookie = ISC_TRUE;
+#endif
                        dns_adb_changeflags(fctx->adb, query->addrinfo,
                                            FCTX_ADDRINFO_NOCOOKIE,
                                            FCTX_ADDRINFO_NOCOOKIE);