]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a logical flaw that would skip logging notify success
authorOndřej Surý <ondrej@isc.org>
Wed, 3 May 2023 06:15:31 +0000 (08:15 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 3 May 2023 19:51:20 +0000 (21:51 +0200)
The notify_done() would never log a success as the logging part was
always skipped.  Fix the code flow in the function.

lib/dns/zone.c

index 05d7d6c1fd2d25e5675a58a8a3e7c6eef49e2385..a7c009678b47a4fbe4633dbec31e01ba124af37e 100644 (file)
@@ -15802,17 +15802,14 @@ notify_done(void *arg) {
                           (int)buf.used, rcode);
        }
 
-       dns_message_detach(&message);
-       goto done;
-
 fail:
        dns_message_detach(&message);
 
        if (result == ISC_R_SUCCESS) {
-               notify_log(notify->zone, ISC_LOG_INFO,
+               notify_log(notify->zone, ISC_LOG_DEBUG(1),
                           "notify to %s successful", addrbuf);
        } else if (result == ISC_R_SHUTTINGDOWN || result == ISC_R_CANCELED) {
-               goto done;
+               /* just destroy the notify */
        } else if ((notify->flags & DNS_NOTIFY_TCP) == 0) {
                notify_log(notify->zone, ISC_LOG_NOTICE,
                           "notify to %s failed: %s: retrying over TCP",
@@ -15830,7 +15827,6 @@ fail:
                           "notify to %s failed: %s", addrbuf,
                           isc_result_totext(result));
        }
-done:
        notify_destroy(notify, false);
 }