]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] assert if sitok/sitbad are insane
authorEvan Hunt <each@isc.org>
Thu, 20 Feb 2014 05:26:31 +0000 (21:26 -0800)
committerEvan Hunt <each@isc.org>
Thu, 20 Feb 2014 05:26:31 +0000 (21:26 -0800)
bin/dig/dighost.c
lib/dns/resolver.c

index 9494cb416dd74e5589cb47674be910d375fe225c..09c78416ae4d3f4d20877af0cb0c32e49e814996 100644 (file)
@@ -3290,11 +3290,12 @@ process_sit(dig_lookup_t *l, dns_message_t *msg,
                len = sizeof(cookie);
        }
 
+       INSIST(msg->sitok == 0 && msg->sitbad == 0);
        if (optlen >= len && optlen >= 8U) {
                if (memcmp(isc_buffer_current(optbuf), sit, 8) == 0) {
                        msg->sitok = 1;
                } else {
-                       printf(";; Warning: SIT client cookie part mis-match\n");
+                       printf(";; Warning: SIT client cookie mismatch\n");
                        msg->sitbad = 1;
                }
        } else {
index 29852030cbe62bbae731bf7fd236117f2676c339..7a3df5a13a7c124a45e1b7f7f1329e5dd5aed46d 100644 (file)
@@ -7033,6 +7033,8 @@ process_opt(resquery_t *query, dns_rdataset_t *opt) {
                        case DNS_OPT_SIT:
                                sit = isc_buffer_current(&optbuf);
                                compute_cc(query, cookie, sizeof(cookie));
+                               INSIST(query->fctx->rmessage->sitbad == 0 &&
+                                      query->fctx->rmessage->sitok == 0);
                                if (optlen >= 8U &&
                                    memcmp(cookie, sit, 8) == 0) {
                                        query->fctx->rmessage->sitok = 1;