]> 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ý <ondrej@isc.org>
Wed, 29 Apr 2026 15:31:23 +0000 (17:31 +0200)
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
bin/check/check-tool.c

index 8d841cd758d02575e948551b13c42dae7087c839..f0db14c7717dd7ad44b86facd67b6b7f555c8c8b 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[] = { ZONEDB_DEFAULT };