]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Resolve ERR_MISSING_GLUE / ERR_EXTRA_AAAA value collision
authorOndřej Surý <ondrej@isc.org>
Wed, 29 Apr 2026 12:03:38 +0000 (14:03 +0200)
committerOndřej Surý (GitLab job 7267183) <ondrej@isc.org>
Wed, 29 Apr 2026 15:32:03 +0000 (15:32 +0000)
Both constants were defined as 5. The symbol table used by checkns() to
deduplicate log messages keys on (name, error_code), so logging an
extra-AAAA error caused logged() to also return true for the
missing-glue check, silently skipping the entire missing-glue block for
the same name in named-checkzone and named-checkconf -z.

Convert the ERR_* defines to an auto-numbered enum so the compiler
guarantees the values stay pairwise distinct.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 72d21a08063400d9a3e9c3d13ccc5ac28bf457c1)

bin/check/check-tool.c

index 0c5fe28c830370f87ecc6e17da9ba9662959a3b8..0b18128d2745af148d1e6f1f5f81594dafb259c1 100644 (file)
 #define CHECK_LOCAL 1
 #endif /* ifndef CHECK_LOCAL */
 
-#define ERR_IS_CNAME      1
-#define ERR_NO_ADDRESSES   2
-#define ERR_LOOKUP_FAILURE 3
-#define ERR_EXTRA_A       4
-#define ERR_EXTRA_AAAA    5
-#define ERR_MISSING_GLUE   5
-#define ERR_IS_MXCNAME    6
-#define ERR_IS_SRVCNAME           7
+enum {
+       ERR_IS_CNAME = 1,
+       ERR_NO_ADDRESSES,
+       ERR_LOOKUP_FAILURE,
+       ERR_EXTRA_A,
+       ERR_EXTRA_AAAA,
+       ERR_MISSING_GLUE,
+       ERR_IS_MXCNAME,
+       ERR_IS_SRVCNAME,
+};
 
 static const char *dbtype[] = { "rbt" };