Resolve ERR_MISSING_GLUE / ERR_EXTRA_AAAA value collision

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 72d21a0806)
This commit is contained in:
Ondřej Surý 2026-04-29 14:03:38 +02:00 committed by Ondřej Surý (GitLab job 7267183)
parent 54b53117ef
commit 3e5fedfcfa

View file

@ -58,14 +58,16 @@
#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" };