2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

deduplicate result codes

ISCCC_R_SYNTAX, ISCCC_R_EXPIRED, and ISCCC_R_CLOCKSKEW have the
same usage and text formats as DNS_R_SYNTAX, DNS_R_EXPIRED and
DNS_R_CLOCKSCREW respectively. this was originally done because
result codes were defined in separate libraries, and some tool
might be linked with libisccc but not libdns. as the result codes
are now defined in only one place, there's no need to retain the
duplicates.
This commit is contained in:
Evan Hunt 2025-01-08 20:13:34 -08:00
parent a19f6c6654
commit 314741fcd0
4 changed files with 3 additions and 12 deletions

View File

@ -489,7 +489,7 @@ control_recvmessage(isc_nmhandle_t *handle ISC_ATTR_UNUSED, isc_result_t result,
if ((sent + CLOCKSKEW) < conn->now ||
(sent - CLOCKSKEW) > conn->now)
{
result = ISCCC_R_CLOCKSKEW;
result = DNS_R_CLOCKSKEW;
goto cleanup;
}
} else {
@ -503,7 +503,7 @@ control_recvmessage(isc_nmhandle_t *handle ISC_ATTR_UNUSED, isc_result_t result,
if (isccc_cc_lookupuint32(conn->ctrl, "_exp", &exp) == ISC_R_SUCCESS &&
conn->now > exp)
{
result = ISCCC_R_EXPIRED;
result = DNS_R_EXPIRED;
goto cleanup;
}

View File

@ -248,10 +248,7 @@ typedef enum isc_result {
DNS_R_BADCOOKIE = DNS_R_NOERROR + 23,
ISCCC_R_UNKNOWNVERSION,
ISCCC_R_SYNTAX,
ISCCC_R_BADAUTH,
ISCCC_R_EXPIRED,
ISCCC_R_CLOCKSKEW,
ISCCC_R_DUPLICATE,
ISCCC_R_MAXDEPTH,

View File

@ -248,10 +248,7 @@ static const char *description[ISC_R_NRESULTS] = {
[DNS_R_BADCOOKIE] = "BADCOOKIE",
[ISCCC_R_UNKNOWNVERSION] = "unknown version",
[ISCCC_R_SYNTAX] = "syntax error",
[ISCCC_R_BADAUTH] = "bad auth",
[ISCCC_R_EXPIRED] = "expired",
[ISCCC_R_CLOCKSKEW] = "clock skew",
[ISCCC_R_DUPLICATE] = "duplicate",
[ISCCC_R_MAXDEPTH] = "max depth",
};
@ -482,10 +479,7 @@ static const char *identifier[ISC_R_NRESULTS] = {
[DNS_R_BADCOOKIE] = "DNS_R_BADCOOKIE",
[ISCCC_R_UNKNOWNVERSION] = "ISCCC_R_UNKNOWNVERSION",
[ISCCC_R_SYNTAX] = "ISCCC_R_SYNTAX",
[ISCCC_R_BADAUTH] = "ISCCC_R_BADAUTH",
[ISCCC_R_EXPIRED] = "ISCCC_R_EXPIRED",
[ISCCC_R_CLOCKSKEW] = "ISCCC_R_CLOCKSKEW",
[ISCCC_R_DUPLICATE] = "ISCCC_R_DUPLICATE",
[ISCCC_R_MAXDEPTH] = "ISCCC_R_MAXDEPTH",
};

View File

@ -530,7 +530,7 @@ value_fromwire(isccc_region_t *source, unsigned int depth,
} else if (msgtype == ISCCC_CCMSGTYPE_LIST) {
result = list_fromwire(&active, depth + 1, valuep);
} else {
result = ISCCC_R_SYNTAX;
result = DNS_R_SYNTAX;
}
return result;