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
#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 };