mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 10:39:59 -04:00
[9.18] chg: dev: Add two new clang-format options that help with code formatting
* Add new clang-format option to remove redundant semicolons * Add new clang-format option to remove redundant parentheses Backport of MR !9749 Merge branch 'backport-ondrej/code-style-2024-9.18' into 'bind-9.18' See merge request isc-projects/bind9!9751
This commit is contained in:
commit
aa10ae45fd
417 changed files with 10827 additions and 10843 deletions
|
|
@ -76,3 +76,5 @@ PenaltyBreakString: 80
|
|||
PenaltyExcessCharacter: 100
|
||||
Standard: Cpp11
|
||||
ContinuationIndentWidth: 8
|
||||
RemoveParentheses: ReturnStatement
|
||||
RemoveSemicolon: true
|
||||
|
|
|
|||
|
|
@ -64,3 +64,5 @@ PenaltyBreakString: 80
|
|||
PenaltyExcessCharacter: 100
|
||||
Standard: Cpp11
|
||||
ContinuationIndentWidth: 8
|
||||
RemoveParentheses: ReturnStatement
|
||||
RemoveSemicolon: true
|
||||
|
|
|
|||
|
|
@ -26,3 +26,7 @@ b8b9b4ac2c0ae88de85f4d83982edb97694959d7
|
|||
fe8d6023e05416ba5c030bb65878a24a57aa16cb
|
||||
# Reformat sources with up-to-date clang-format-19
|
||||
50221d6ff1ebfbd7bc97d11a17d12f0a5926d18a
|
||||
# Remove redundant semicolons after the closing braces of functions
|
||||
b3d8f2796a2a060b35a5e77d808dd031db2a3a37
|
||||
# Remove redundant parentheses from the return statement
|
||||
c5bac96fd07493a13e791ea81de1d05697b983f6
|
||||
|
|
|
|||
|
|
@ -146,14 +146,14 @@ logged(char *key, int value) {
|
|||
isc_result_t result;
|
||||
|
||||
if (symtab == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
result = isc_symtab_lookup(symtab, key, value, NULL);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -177,7 +177,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
|||
aaaa->type == dns_rdatatype_aaaa);
|
||||
|
||||
if (a == NULL || aaaa == NULL) {
|
||||
return (answer);
|
||||
return answer;
|
||||
}
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
|
|
@ -234,7 +234,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
|||
add(namebuf, ERR_NO_ADDRESSES);
|
||||
}
|
||||
/* XXX950 make fatal for 9.5.0 */
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
default:
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
|
|
@ -243,7 +243,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
|||
gai_strerror(result));
|
||||
add(namebuf, ERR_LOOKUP_FAILURE);
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -371,7 +371,7 @@ checkmissing:
|
|||
}
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
return (answer);
|
||||
return answer;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -434,7 +434,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
|||
}
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
return (answer);
|
||||
return answer;
|
||||
|
||||
case EAI_NONAME:
|
||||
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
|
||||
|
|
@ -448,7 +448,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
|||
add(namebuf, ERR_NO_ADDRESSES);
|
||||
}
|
||||
/* XXX950 make fatal for 9.5.0. */
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
default:
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
|
|
@ -457,7 +457,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
|||
gai_strerror(result));
|
||||
add(namebuf, ERR_LOOKUP_FAILURE);
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -521,7 +521,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
|||
}
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
return (answer);
|
||||
return answer;
|
||||
|
||||
case EAI_NONAME:
|
||||
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
|
||||
|
|
@ -535,7 +535,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
|||
add(namebuf, ERR_NO_ADDRESSES);
|
||||
}
|
||||
/* XXX950 make fatal for 9.5.0. */
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
default:
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
|
|
@ -544,7 +544,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
|||
gai_strerror(result));
|
||||
add(namebuf, ERR_LOOKUP_FAILURE);
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -573,7 +573,7 @@ setup_logging(isc_mem_t *mctx, FILE *errout, isc_log_t **logp) {
|
|||
ISC_R_SUCCESS);
|
||||
|
||||
*logp = log;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*% load the zone */
|
||||
|
|
@ -648,7 +648,7 @@ cleanup:
|
|||
if (zone != NULL) {
|
||||
dns_zone_detach(&zone);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*% dump the zone */
|
||||
|
|
@ -679,7 +679,7 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
|
|||
"could not open output "
|
||||
"file \"%s\" for writing\n",
|
||||
filename);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -689,5 +689,5 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
|
|||
(void)isc_stdio_close(output);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,10 +90,10 @@ directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
|
|||
cfg_obj_log(obj, logc, ISC_LOG_ERROR,
|
||||
"change directory to '%s' failed: %s\n", directory,
|
||||
isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -101,10 +101,10 @@ get_maps(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
|
|||
int i;
|
||||
for (i = 0;; i++) {
|
||||
if (maps[i] == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
|
|||
|
||||
for (i = 0;; i++) {
|
||||
if (maps[i] == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
checknames = NULL;
|
||||
result = cfg_map_get(maps[i], "check-names", &checknames);
|
||||
|
|
@ -129,7 +129,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
|
|||
}
|
||||
if (checknames != NULL && !cfg_obj_islist(checknames)) {
|
||||
*obj = checknames;
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
for (element = cfg_list_first(checknames); element != NULL;
|
||||
element = cfg_list_next(element))
|
||||
|
|
@ -143,7 +143,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
|
|||
continue;
|
||||
}
|
||||
*obj = cfg_tuple_get(value, "mode");
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -156,23 +156,23 @@ configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
|
|||
isc_textregion_t r;
|
||||
|
||||
if (zfile == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
DE_CONST(zclass, r.base);
|
||||
r.length = strlen(zclass);
|
||||
result = dns_rdataclass_fromtext(&rdclass, &r);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = dns_rootns_create(mctx, rdclass, zfile, &db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
dns_db_detach(&db);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*% configure the zone */
|
||||
|
|
@ -228,18 +228,18 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
|
|||
printf("%s %s %s in-view %s\n", zname, zclass, view, inview);
|
||||
}
|
||||
if (inviewobj != NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
cfg_map_get(zoptions, "type", &typeobj);
|
||||
if (typeobj == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (list) {
|
||||
const char *ztype = cfg_obj_asstring(typeobj);
|
||||
printf("%s %s %s %s\n", zname, zclass, view, ztype);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -249,12 +249,12 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
|
|||
if (dbobj != NULL && strcmp("rbt", cfg_obj_asstring(dbobj)) != 0 &&
|
||||
strcmp("rbt64", cfg_obj_asstring(dbobj)) != 0)
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
cfg_map_get(zoptions, "dlz", &dlzobj);
|
||||
if (dlzobj != NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
cfg_map_get(zoptions, "file", &fileobj);
|
||||
|
|
@ -268,12 +268,12 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
|
|||
* master and redirect
|
||||
*/
|
||||
if (strcasecmp(cfg_obj_asstring(typeobj), "hint") == 0) {
|
||||
return (configure_hint(zfile, zclass, mctx));
|
||||
return configure_hint(zfile, zclass, mctx);
|
||||
} else if ((strcasecmp(cfg_obj_asstring(typeobj), "primary") != 0) &&
|
||||
(strcasecmp(cfg_obj_asstring(typeobj), "master") != 0) &&
|
||||
(strcasecmp(cfg_obj_asstring(typeobj), "redirect") != 0))
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -286,12 +286,12 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
|
|||
}
|
||||
|
||||
if (primariesobj != NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
if (zfile == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
|
|
@ -458,7 +458,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
|
|||
fprintf(stderr, "%s/%s/%s: %s\n", view, zname, zclass,
|
||||
isc_result_totext(result));
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*% configure a view */
|
||||
|
|
@ -493,7 +493,7 @@ configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
|
|||
result = tresult;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -503,11 +503,11 @@ config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
|
|||
|
||||
if (!cfg_obj_isstring(classobj)) {
|
||||
*classp = defclass;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
DE_CONST(cfg_obj_asstring(classobj), r.base);
|
||||
r.length = strlen(r.base);
|
||||
return (dns_rdataclass_fromtext(classp, &r));
|
||||
return dns_rdataclass_fromtext(classp, &r);
|
||||
}
|
||||
|
||||
/*% load zones from the configuration */
|
||||
|
|
@ -565,7 +565,7 @@ load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -750,5 +750,5 @@ main(int argc, char **argv) {
|
|||
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return (exit_status);
|
||||
return exit_status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -565,5 +565,5 @@ main(int argc, char **argv) {
|
|||
}
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return ((result == ISC_R_SUCCESS) ? 0 : 1);
|
||||
return (result == ISC_R_SUCCESS) ? 0 : 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,24 +45,24 @@ alg_fromtext(const char *name) {
|
|||
}
|
||||
|
||||
if (strcasecmp(p, "md5") == 0) {
|
||||
return (DST_ALG_HMACMD5);
|
||||
return DST_ALG_HMACMD5;
|
||||
}
|
||||
if (strcasecmp(p, "sha1") == 0) {
|
||||
return (DST_ALG_HMACSHA1);
|
||||
return DST_ALG_HMACSHA1;
|
||||
}
|
||||
if (strcasecmp(p, "sha224") == 0) {
|
||||
return (DST_ALG_HMACSHA224);
|
||||
return DST_ALG_HMACSHA224;
|
||||
}
|
||||
if (strcasecmp(p, "sha256") == 0) {
|
||||
return (DST_ALG_HMACSHA256);
|
||||
return DST_ALG_HMACSHA256;
|
||||
}
|
||||
if (strcasecmp(p, "sha384") == 0) {
|
||||
return (DST_ALG_HMACSHA384);
|
||||
return DST_ALG_HMACSHA384;
|
||||
}
|
||||
if (strcasecmp(p, "sha512") == 0) {
|
||||
return (DST_ALG_HMACSHA512);
|
||||
return DST_ALG_HMACSHA512;
|
||||
}
|
||||
return (DST_ALG_UNKNOWN);
|
||||
return DST_ALG_UNKNOWN;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -72,19 +72,19 @@ int
|
|||
alg_bits(dns_secalg_t alg) {
|
||||
switch (alg) {
|
||||
case DST_ALG_HMACMD5:
|
||||
return (128);
|
||||
return 128;
|
||||
case DST_ALG_HMACSHA1:
|
||||
return (160);
|
||||
return 160;
|
||||
case DST_ALG_HMACSHA224:
|
||||
return (224);
|
||||
return 224;
|
||||
case DST_ALG_HMACSHA256:
|
||||
return (256);
|
||||
return 256;
|
||||
case DST_ALG_HMACSHA384:
|
||||
return (384);
|
||||
return 384;
|
||||
case DST_ALG_HMACSHA512:
|
||||
return (512);
|
||||
return 512;
|
||||
default:
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ set_user(FILE *fd, const char *user) {
|
|||
pw = getpwnam(user);
|
||||
if (pw == NULL) {
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
return (fchown(fileno(fd), pw->pw_uid, -1));
|
||||
return fchown(fileno(fd), pw->pw_uid, -1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,5 +291,5 @@ options {\n\
|
|||
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -297,5 +297,5 @@ nsupdate -k <keyfile>\n");
|
|||
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -437,11 +437,11 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
|
|||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
dns_name_format(owner, namebuf, sizeof(namebuf));
|
||||
delv_log(ISC_LOG_DEBUG(4), "WARN: empty rdataset %s", namebuf);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (!showdnssec && rdataset->type == dns_rdatatype_rrsig) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (first || rdataset->trust != trust) {
|
||||
|
|
@ -516,7 +516,7 @@ cleanup:
|
|||
isc_mem_put(mctx, t, len);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -568,7 +568,7 @@ setup_style(dns_master_style_t **stylep) {
|
|||
if (result == ISC_R_SUCCESS) {
|
||||
*stylep = style;
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -589,11 +589,11 @@ convert_name(dns_fixedname_t *fn, dns_name_t **name, const char *text) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
delv_log(ISC_LOG_ERROR, "failed to convert QNAME %s: %s", text,
|
||||
isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
*name = n;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -624,7 +624,7 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
|
|||
CHECK(convert_name(&fkeyname, &keyname, keynamestr));
|
||||
|
||||
if (!root_validation) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (anchor_name) {
|
||||
|
|
@ -632,11 +632,11 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
|
|||
}
|
||||
|
||||
if (!match_root) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (!root_validation) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
delv_log(ISC_LOG_DEBUG(3), "adding trust anchor %s", trust_anchor);
|
||||
|
|
@ -778,7 +778,7 @@ cleanup:
|
|||
result = ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -803,7 +803,7 @@ cleanup:
|
|||
if (result == DST_R_NOCRYPTO) {
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -817,7 +817,7 @@ setup_dnsseckeys(dns_client_t *client) {
|
|||
const char *filename = anchorfile;
|
||||
|
||||
if (!root_validation) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (filename == NULL) {
|
||||
|
|
@ -893,7 +893,7 @@ cleanup:
|
|||
delv_log(ISC_LOG_ERROR, "setup_dnsseckeys: %s",
|
||||
isc_result_totext(result));
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -946,7 +946,7 @@ addserver(dns_client_t *client) {
|
|||
if (gaierror != 0) {
|
||||
delv_log(ISC_LOG_ERROR, "getaddrinfo failed: %s",
|
||||
gai_strerror(gaierror));
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = ISC_R_SUCCESS;
|
||||
|
|
@ -981,7 +981,7 @@ cleanup:
|
|||
isc_result_totext(result));
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1056,7 +1056,7 @@ cleanup:
|
|||
if (resconf != NULL) {
|
||||
irs_resconf_destroy(&resconf);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1069,10 +1069,10 @@ parse_uint(uint32_t *uip, const char *value, uint32_t max, const char *desc) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
printf("invalid %s '%s': %s\n", desc, value,
|
||||
isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
*uip = n;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1352,7 +1352,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
|
|||
if (strlen(option) > 1U) {
|
||||
option = &option[1];
|
||||
} else {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
opt = option[0];
|
||||
|
|
@ -1369,7 +1369,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
|
|||
switch (opt) {
|
||||
case 'a':
|
||||
anchorfile = isc_mem_strdup(mctx, value);
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'b':
|
||||
hash = strchr(value, '#');
|
||||
if (hash != NULL) {
|
||||
|
|
@ -1406,7 +1406,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
|
|||
if (hash != NULL) {
|
||||
*hash = '#';
|
||||
}
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'c':
|
||||
if (classset) {
|
||||
warn("extra query class");
|
||||
|
|
@ -1424,24 +1424,24 @@ dash_option(char *option, char *next, bool *open_type_class) {
|
|||
} else {
|
||||
warn("ignoring invalid class");
|
||||
}
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'd':
|
||||
result = parse_uint(&num, value, 99, "debug level");
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("Couldn't parse debug level");
|
||||
}
|
||||
loglevel = num;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'p':
|
||||
port = value;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'q':
|
||||
if (curqname != NULL) {
|
||||
warn("extra query name");
|
||||
isc_mem_free(mctx, curqname);
|
||||
}
|
||||
curqname = isc_mem_strdup(mctx, value);
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 't':
|
||||
*open_type_class = false;
|
||||
tr.base = value;
|
||||
|
|
@ -1462,7 +1462,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
|
|||
} else {
|
||||
warn("ignoring invalid type");
|
||||
}
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'x':
|
||||
result = get_reverse(textname, sizeof(textname), value, false);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
|
|
@ -1480,14 +1480,14 @@ dash_option(char *option, char *next, bool *open_type_class) {
|
|||
fprintf(stderr, "Invalid IP address %s\n", value);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
invalid_option:
|
||||
default:
|
||||
fprintf(stderr, "Invalid option: -%s\n", option);
|
||||
usage();
|
||||
}
|
||||
UNREACHABLE();
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1649,11 +1649,11 @@ parse_args(int argc, char **argv) {
|
|||
static isc_result_t
|
||||
append_str(const char *text, int len, char **p, char *end) {
|
||||
if (len > end - *p) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
memmove(*p, text, len);
|
||||
*p += len;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1664,17 +1664,17 @@ reverse_octets(const char *in, char **p, char *end) {
|
|||
isc_result_t result;
|
||||
result = reverse_octets(dot + 1, p, end);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
result = append_str(".", 1, p, end);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
len = (int)(dot - in);
|
||||
} else {
|
||||
len = strlen(in);
|
||||
}
|
||||
return (append_str(in, len, p, end));
|
||||
return append_str(in, len, p, end);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1694,10 +1694,10 @@ get_reverse(char *reverse, size_t len, char *value, bool strict) {
|
|||
name = dns_fixedname_initname(&fname);
|
||||
result = dns_byaddr_createptrname(&addr, options, name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
dns_name_format(name, reverse, (unsigned int)len);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
/*
|
||||
* Not a valid IPv6 address. Assume IPv4.
|
||||
|
|
@ -1710,17 +1710,17 @@ get_reverse(char *reverse, size_t len, char *value, bool strict) {
|
|||
char *p = reverse;
|
||||
char *end = reverse + len;
|
||||
if (strict && inet_pton(AF_INET, value, &addr.type.in) != 1) {
|
||||
return (DNS_R_BADDOTTEDQUAD);
|
||||
return DNS_R_BADDOTTEDQUAD;
|
||||
}
|
||||
result = reverse_octets(value, &p, end);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
result = append_str(".in-addr.arpa.", 15, &p, end);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1872,5 +1872,5 @@ cleanup:
|
|||
|
||||
dst_lib_destroy();
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ rcode_totext(dns_rcode_t rcode) {
|
|||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
if (strspn(buf + 1, "0123456789") == strlen(buf + 1)) {
|
||||
buf[0] = '?';
|
||||
return (buf);
|
||||
return buf;
|
||||
}
|
||||
return (buf + 1);
|
||||
return buf + 1;
|
||||
}
|
||||
|
||||
/*% print usage */
|
||||
|
|
@ -443,7 +443,7 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
|
|||
if (query->lookup->trace || query->lookup->ns_search_only) {
|
||||
result = dns_rdatatype_totext(rdata->type, buf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
ADD_STRING(buf, " ");
|
||||
}
|
||||
|
|
@ -464,7 +464,7 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
|
|||
result = dns_rdata_tofmttext(rdata, NULL, styleflags, 0, splitwidth,
|
||||
" ", buf);
|
||||
if (result == ISC_R_NOSPACE) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
check_result(result, "dns_rdata_totext");
|
||||
if (query->lookup->identify) {
|
||||
|
|
@ -481,7 +481,7 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
|
|||
ADD_STRING(buf, store);
|
||||
}
|
||||
ADD_STRING(buf, "\n");
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -504,14 +504,14 @@ dns64prefix_answer(dns_message_t *msg, isc_buffer_t *buf) {
|
|||
dns_rdatatype_aaaa, dns_rdatatype_none,
|
||||
NULL, &rdataset);
|
||||
if (result == DNS_R_NXDOMAIN || result == DNS_R_NXRRSET) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = dns_dns64_findprefix(rdataset, prefix, &count);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
if (count > 10) {
|
||||
count = 10;
|
||||
|
|
@ -519,15 +519,15 @@ dns64prefix_answer(dns_message_t *msg, isc_buffer_t *buf) {
|
|||
for (i = 0; i < count; i++) {
|
||||
result = isc_netaddr_totext(&prefix[i].addr, buf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
result = isc_buffer_printf(buf, "/%u\n", prefix[i].prefixlen);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -547,9 +547,9 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags, isc_buffer_t *buf,
|
|||
dns_name_init(&empty_name, NULL);
|
||||
result = dns_message_firstname(msg, DNS_SECTION_ANSWER);
|
||||
if (result == ISC_R_NOMORE) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
|
@ -564,7 +564,7 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags, isc_buffer_t *buf,
|
|||
dns_rdataset_current(rdataset, &rdata);
|
||||
result = say_message(&rdata, query, buf);
|
||||
if (result == ISC_R_NOSPACE) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
check_result(result, "say_message");
|
||||
loopresult = dns_rdataset_next(rdataset);
|
||||
|
|
@ -575,11 +575,11 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags, isc_buffer_t *buf,
|
|||
if (result == ISC_R_NOMORE) {
|
||||
break;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -597,10 +597,10 @@ isdotlocal(dns_message_t *msg) {
|
|||
dns_name_t *name = NULL;
|
||||
dns_message_currentname(msg, DNS_SECTION_QUESTION, &name);
|
||||
if (dns_name_issubdomain(name, &local)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -993,7 +993,7 @@ repopulate_buffer:
|
|||
|
||||
dig_idnsetup(query->lookup, false);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -1177,7 +1177,7 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
|||
|
||||
if ((cmd = strtok_r(option, "=", &last)) == NULL) {
|
||||
printf(";; Invalid option %s\n", option);
|
||||
return (lookup);
|
||||
return lookup;
|
||||
}
|
||||
if (strncasecmp(cmd, "no", 2) == 0) {
|
||||
cmd += 2;
|
||||
|
|
@ -2212,7 +2212,7 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
|||
if (value != NULL) {
|
||||
value[-1] = '=';
|
||||
}
|
||||
return (lookup);
|
||||
return lookup;
|
||||
|
||||
#if !TARGET_OS_IPHONE
|
||||
exit_or_usage:
|
||||
|
|
@ -2258,7 +2258,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
} else {
|
||||
fatal("can't find IPv4 networking");
|
||||
UNREACHABLE();
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case '6':
|
||||
|
|
@ -2268,7 +2268,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
} else {
|
||||
fatal("can't find IPv6 networking");
|
||||
UNREACHABLE();
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
|
|
@ -2277,7 +2277,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
cmd = option;
|
||||
FULLCHECK("debug");
|
||||
debugging = true;
|
||||
return (false);
|
||||
return false;
|
||||
} else {
|
||||
debugging = true;
|
||||
}
|
||||
|
|
@ -2310,7 +2310,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
if (strlen(option) > 1U) {
|
||||
option = &option[1];
|
||||
} else {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
opt = option[0];
|
||||
|
|
@ -2354,7 +2354,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
*hash = '#';
|
||||
}
|
||||
specified_source = true;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'c':
|
||||
if ((*lookup)->rdclassset) {
|
||||
fprintf(stderr, ";; Warning, extra class option\n");
|
||||
|
|
@ -2373,13 +2373,13 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
"invalid class %s\n",
|
||||
value);
|
||||
}
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'f':
|
||||
atomic_store(&batchname, (uintptr_t)value);
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'k':
|
||||
strlcpy(keyfile, value, sizeof(keyfile));
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'p':
|
||||
result = parse_uint(&num, value, MAXPORT, "port number");
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
@ -2387,7 +2387,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
}
|
||||
port = num;
|
||||
port_set = true;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'q':
|
||||
if (!config_only) {
|
||||
if (*need_clone) {
|
||||
|
|
@ -2406,7 +2406,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
ISC_LIST_APPEND(lookup_list, (*lookup), link);
|
||||
debug("looking up %s", (*lookup)->textname);
|
||||
}
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 't':
|
||||
*open_type_class = false;
|
||||
if (strncasecmp(value, "ixfr=", 5) == 0) {
|
||||
|
|
@ -2464,7 +2464,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
"invalid type %s\n",
|
||||
value);
|
||||
}
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'y':
|
||||
if ((ptr = strtok_r(value, ":", &last)) == NULL) {
|
||||
usage();
|
||||
|
|
@ -2489,7 +2489,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
ptr[-1] = ':';
|
||||
}
|
||||
ptr2[-1] = ':';
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'x':
|
||||
if (*need_clone) {
|
||||
*lookup = clone_lookup(default_lookup, true);
|
||||
|
|
@ -2519,14 +2519,14 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
fprintf(stderr, "Invalid IP address %s\n", value);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
invalid_option:
|
||||
default:
|
||||
fprintf(stderr, "Invalid option: -%s\n", option);
|
||||
usage();
|
||||
}
|
||||
UNREACHABLE();
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2620,7 +2620,7 @@ split_batchline(char *batchline, char **bargv, int len, const char *msg) {
|
|||
{
|
||||
debug("%s %d: %s", msg, bargc, bargv[bargc]);
|
||||
}
|
||||
return (bargc);
|
||||
return bargc;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -3107,5 +3107,5 @@ main(int argc, char **argv) {
|
|||
dig_startup();
|
||||
dig_shutdown();
|
||||
|
||||
return (exitcode);
|
||||
return exitcode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ count_dots(char *string) {
|
|||
}
|
||||
s++;
|
||||
}
|
||||
return (i);
|
||||
return i;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -307,11 +307,11 @@ hex_dump(isc_buffer_t *b) {
|
|||
static isc_result_t
|
||||
append(const char *text, size_t len, char **p, char *end) {
|
||||
if (*p + len > end) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
memmove(*p, text, len);
|
||||
*p += len;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -322,17 +322,17 @@ reverse_octets(const char *in, char **p, char *end) {
|
|||
isc_result_t result;
|
||||
result = reverse_octets(dot + 1, p, end);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
result = append(".", 1, p, end);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
len = (int)(dot - in);
|
||||
} else {
|
||||
len = (int)strlen(in);
|
||||
}
|
||||
return (append(in, len, p, end));
|
||||
return append(in, len, p, end);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -352,10 +352,10 @@ get_reverse(char *reverse, size_t len, char *value, bool strict) {
|
|||
name = dns_fixedname_initname(&fname);
|
||||
result = dns_byaddr_createptrname(&addr, options, name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
dns_name_format(name, reverse, (unsigned int)len);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
/*
|
||||
* Not a valid IPv6 address. Assume IPv4.
|
||||
|
|
@ -368,18 +368,18 @@ get_reverse(char *reverse, size_t len, char *value, bool strict) {
|
|||
char *p = reverse;
|
||||
char *end = reverse + len;
|
||||
if (strict && inet_pton(AF_INET, value, &addr.type.in) != 1) {
|
||||
return (DNS_R_BADDOTTEDQUAD);
|
||||
return DNS_R_BADDOTTEDQUAD;
|
||||
}
|
||||
result = reverse_octets(value, &p, end);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
/* Append .in-addr.arpa. and a terminating NUL. */
|
||||
result = append(".in-addr.arpa.", 15, &p, end);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -480,7 +480,7 @@ make_server(const char *servname, const char *userarg) {
|
|||
strlcpy(srv->servername, servname, MXNAME);
|
||||
strlcpy(srv->userarg, userarg, MXNAME);
|
||||
ISC_LINK_INIT(srv, link);
|
||||
return (srv);
|
||||
return srv;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -652,7 +652,7 @@ make_empty_lookup(void) {
|
|||
debug("make_empty_lookup() = %p->references = %" PRIuFAST32, looknew,
|
||||
isc_refcount_current(&looknew->references));
|
||||
|
||||
return (looknew);
|
||||
return looknew;
|
||||
}
|
||||
|
||||
#define EDNSOPT_OPTIONS 100U
|
||||
|
|
@ -837,7 +837,7 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
|
|||
|
||||
looknew->magic = DIG_LOOKUP_MAGIC;
|
||||
|
||||
return (looknew);
|
||||
return looknew;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -867,7 +867,7 @@ requeue_lookup(dig_lookup_t *lookold, bool servers) {
|
|||
ISC_LIST_PREPEND(lookup_list, looknew, link);
|
||||
debug("after insertion, init -> %p, new = %p, new -> %p", lookold,
|
||||
looknew, looknew->link.next);
|
||||
return (looknew);
|
||||
return looknew;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -929,20 +929,20 @@ parse_uint_helper(uint32_t *uip, const char *value, uint32_t max,
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
printf("invalid %s '%s': %s\n", desc, value,
|
||||
isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
*uip = n;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
parse_uint(uint32_t *uip, const char *value, uint32_t max, const char *desc) {
|
||||
return (parse_uint_helper(uip, value, max, desc, 10));
|
||||
return parse_uint_helper(uip, value, max, desc, 10);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
parse_xint(uint32_t *uip, const char *value, uint32_t max, const char *desc) {
|
||||
return (parse_uint_helper(uip, value, max, desc, 0));
|
||||
return parse_uint_helper(uip, value, max, desc, 0);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
|
|
@ -955,7 +955,7 @@ parse_bits(char *arg, const char *desc, uint32_t max) {
|
|||
fatal("couldn't parse digest bits");
|
||||
}
|
||||
tmp = (tmp + 7) & ~0x7U;
|
||||
return (tmp);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -1033,7 +1033,7 @@ done:
|
|||
sa->length = prefix_length;
|
||||
*sap = sa;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1109,7 +1109,7 @@ read_confkey(void) {
|
|||
isc_result_t result;
|
||||
|
||||
if (!isc_file_exists(keyfile)) {
|
||||
return (ISC_R_FILENOTFOUND);
|
||||
return ISC_R_FILENOTFOUND;
|
||||
}
|
||||
|
||||
result = cfg_parser_create(mctx, NULL, &pctx);
|
||||
|
|
@ -1150,7 +1150,7 @@ cleanup:
|
|||
cfg_parser_destroy(&pctx);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1229,7 +1229,7 @@ make_searchlist_entry(char *domain) {
|
|||
strlcpy(search->origin, domain, MXNAME);
|
||||
search->origin[MXNAME - 1] = 0;
|
||||
ISC_LINK_INIT(search, link);
|
||||
return (search);
|
||||
return search;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1576,13 +1576,13 @@ check_if_queries_done(dig_lookup_t *l, dig_query_t *except_q) {
|
|||
if (!q->started || isc_refcount_current(&q->references) > 1) {
|
||||
if (!q->canceled && q != except_q) {
|
||||
debug("there is a pending query %p", q);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
q = ISC_LIST_NEXT(q, link);
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1892,7 +1892,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) {
|
|||
result = dns_message_findtype(name, dns_rdatatype_soa,
|
||||
0, &rdataset);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
rdataset = NULL;
|
||||
|
|
@ -1995,7 +1995,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) {
|
|||
if (lookup == NULL && section == DNS_SECTION_ANSWER &&
|
||||
(query->lookup->trace || query->lookup->ns_search_only))
|
||||
{
|
||||
return (followup_lookup(msg, query, DNS_SECTION_AUTHORITY));
|
||||
return followup_lookup(msg, query, DNS_SECTION_AUTHORITY);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2027,7 +2027,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) {
|
|||
link);
|
||||
}
|
||||
|
||||
return (numLookups);
|
||||
return numLookups;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2054,7 +2054,7 @@ next_origin(dig_lookup_t *oldlookup) {
|
|||
* We're not using a search list, so don't even think
|
||||
* about finding the next entry.
|
||||
*/
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2066,14 +2066,14 @@ next_origin(dig_lookup_t *oldlookup) {
|
|||
(dns_name_isabsolute(name) ||
|
||||
(int)dns_name_countlabels(name) > ndots))
|
||||
{
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (oldlookup->origin == NULL && !oldlookup->need_search) {
|
||||
/*
|
||||
* Then we just did rootorg; there's nothing left.
|
||||
*/
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
if (oldlookup->origin == NULL && oldlookup->need_search) {
|
||||
newlookup = requeue_lookup(oldlookup, true);
|
||||
|
|
@ -2082,13 +2082,13 @@ next_origin(dig_lookup_t *oldlookup) {
|
|||
} else {
|
||||
search = ISC_LIST_NEXT(oldlookup->origin, link);
|
||||
if (search == NULL && oldlookup->done_as_is) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
newlookup = requeue_lookup(oldlookup, true);
|
||||
newlookup->origin = search;
|
||||
}
|
||||
cancel_lookup(oldlookup);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2195,7 +2195,7 @@ _new_query(dig_lookup_t *lookup, char *servname, char *userarg,
|
|||
ISC_LINK_INIT(query, link);
|
||||
|
||||
query->magic = DIG_QUERY_MAGIC;
|
||||
return (query);
|
||||
return query;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2332,7 +2332,7 @@ setup_lookup(dig_lookup_t *lookup) {
|
|||
dns_message_puttempname(lookup->sendmsg,
|
||||
&lookup->oname);
|
||||
if (result == DNS_R_NAMETOOLONG) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
fatal("'%s' is not in legal name syntax (%s)",
|
||||
lookup->textname,
|
||||
|
|
@ -2359,7 +2359,7 @@ setup_lookup(dig_lookup_t *lookup) {
|
|||
lookup->textname, isc_result_totext(result));
|
||||
#if TARGET_OS_IPHONE
|
||||
clear_current_lookup();
|
||||
return (false);
|
||||
return false;
|
||||
#else /* if TARGET_OS_IPHONE */
|
||||
cleanup_openssl_refs();
|
||||
digexit();
|
||||
|
|
@ -2691,7 +2691,7 @@ setup_lookup(dig_lookup_t *lookup) {
|
|||
ISC_LIST_ENQUEUE(lookup->q, query, link);
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2840,7 +2840,7 @@ get_create_tls_context(dig_query_t *query, const bool is_https,
|
|||
|
||||
if (query->lookup->tls_key_file_set != query->lookup->tls_cert_file_set)
|
||||
{
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
isc_sockaddr_format(&query->sockaddr, tlsctxname, sizeof(tlsctxname));
|
||||
|
|
@ -2919,7 +2919,7 @@ get_create_tls_context(dig_query_t *query, const bool is_https,
|
|||
INSIST(*psess_cache == NULL);
|
||||
*psess_cache = sess_cache;
|
||||
}
|
||||
return (ctx);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
if (psess_cache != NULL) {
|
||||
|
|
@ -2928,7 +2928,7 @@ get_create_tls_context(dig_query_t *query, const bool is_https,
|
|||
}
|
||||
|
||||
INSIST(!query->lookup->tls_ca_set || found_store != NULL);
|
||||
return (found_ctx);
|
||||
return found_ctx;
|
||||
failure:
|
||||
if (ctx != NULL) {
|
||||
isc_tlsctx_free(&ctx);
|
||||
|
|
@ -2943,7 +2943,7 @@ failure:
|
|||
if (store != NULL && store != found_store) {
|
||||
isc_tls_cert_store_free(&store);
|
||||
}
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -3365,12 +3365,12 @@ try_next_server(dig_lookup_t *lookup) {
|
|||
|
||||
current_query = lookup->current_query;
|
||||
if (current_query == NULL || !ISC_LINK_LINKED(current_query, link)) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
next_query = ISC_LIST_NEXT(current_query, link);
|
||||
if (next_query == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
debug("trying next server...");
|
||||
|
|
@ -3381,7 +3381,7 @@ try_next_server(dig_lookup_t *lookup) {
|
|||
start_udp(next_query);
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -3722,7 +3722,7 @@ check_for_more_data(dig_lookup_t *lookup, dig_query_t *query,
|
|||
result = dns_message_firstname(msg, DNS_SECTION_ANSWER);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
puts("; Transfer failed.");
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
do {
|
||||
dns_name_t *name;
|
||||
|
|
@ -3748,7 +3748,7 @@ check_for_more_data(dig_lookup_t *lookup, dig_query_t *query,
|
|||
{
|
||||
puts("; Transfer failed. "
|
||||
"Didn't start with SOA answer.");
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if ((!query->second_rr_rcvd) &&
|
||||
(rdata.type != dns_rdatatype_soa))
|
||||
|
|
@ -3828,10 +3828,10 @@ check_for_more_data(dig_lookup_t *lookup, dig_query_t *query,
|
|||
isc_nmhandle_detach(&query->readhandle);
|
||||
launch_next_query(query);
|
||||
query_detach(&query);
|
||||
return (false);
|
||||
return false;
|
||||
doexit:
|
||||
dighost_received(len, peer, query);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -3925,7 +3925,7 @@ process_opt(dig_lookup_t *l, dns_message_t *msg) {
|
|||
|
||||
static int
|
||||
ednsvers(dns_rdataset_t *opt) {
|
||||
return ((opt->ttl >> 16) & 0xff);
|
||||
return (opt->ttl >> 16) & 0xff;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -4138,8 +4138,7 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
|
|||
if (l->tcp_mode) {
|
||||
bool fail = true;
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if ((!query->first_soa_rcvd || query->warn_id))
|
||||
{
|
||||
if (!query->first_soa_rcvd || query->warn_id) {
|
||||
dighost_warning("%s: ID mismatch: "
|
||||
"expected ID %u, got "
|
||||
"%u",
|
||||
|
|
@ -4595,12 +4594,12 @@ get_address(char *host, in_port_t myport, isc_sockaddr_t *sockaddr) {
|
|||
isc_app_unblock();
|
||||
}
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
INSIST(count == 1);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -4622,7 +4621,7 @@ getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp) {
|
|||
fatal("couldn't get address for '%s': %s", host,
|
||||
isc_result_totext(result));
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
|
|
@ -4632,7 +4631,7 @@ getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp) {
|
|||
ISC_LIST_APPEND(lookup->my_server_list, srv, link);
|
||||
}
|
||||
|
||||
return (count);
|
||||
return count;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -4841,7 +4840,7 @@ cleanup:
|
|||
idn2_free(dst);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -4991,8 +4990,8 @@ dig_idnsetup(dig_lookup_t *lookup, bool active) {
|
|||
bool
|
||||
dig_lookup_is_tls(const dig_lookup_t *lookup) {
|
||||
if (lookup->tls_mode || (lookup->tls_ca_set && !lookup->https_mode)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ rcode_totext(dns_rcode_t rcode) {
|
|||
} else {
|
||||
totext.consttext = rcodetext[rcode];
|
||||
}
|
||||
return (totext.deconsttext);
|
||||
return totext.deconsttext;
|
||||
}
|
||||
|
||||
noreturn static void
|
||||
|
|
@ -224,9 +224,9 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
|||
|
||||
result = dns_message_firstname(msg, sectionid);
|
||||
if (result == ISC_R_NOMORE) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
|
@ -264,7 +264,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
|||
print_name, false,
|
||||
no_rdata, &target);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
#ifdef USEINITALWS
|
||||
if (first) {
|
||||
|
|
@ -319,11 +319,11 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
|||
if (result == ISC_R_NOMORE) {
|
||||
break;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -343,12 +343,12 @@ printrdata(dns_message_t *msg, dns_rdataset_t *rdataset,
|
|||
|
||||
result = dns_rdataset_totext(rdataset, owner, false, false, &target);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
isc_buffer_usedregion(&target, &r);
|
||||
printf("%.*s", (int)r.length, (char *)r.base);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -425,7 +425,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
: query->lookup->textname,
|
||||
msg->rcode, rcode_totext(msg->rcode));
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (default_lookups && query->lookup->rdtype == dns_rdatatype_a) {
|
||||
|
|
@ -519,7 +519,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
result = printsection(msg, DNS_SECTION_QUESTION, "QUESTION",
|
||||
true, query);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (!ISC_LIST_EMPTY(msg->sections[DNS_SECTION_ANSWER])) {
|
||||
|
|
@ -529,7 +529,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
result = printsection(msg, DNS_SECTION_ANSWER, "ANSWER",
|
||||
!short_form, query);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -540,7 +540,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
result = printsection(msg, DNS_SECTION_AUTHORITY, "AUTHORITY",
|
||||
true, query);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (!ISC_LIST_EMPTY(msg->sections[DNS_SECTION_ADDITIONAL]) &&
|
||||
|
|
@ -550,7 +550,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
result = printsection(msg, DNS_SECTION_ADDITIONAL, "ADDITIONAL",
|
||||
true, query);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if ((tsig != NULL) && !short_form) {
|
||||
|
|
@ -558,7 +558,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
result = printrdata(msg, tsig, tsigname, "PSEUDOSECTION TSIG",
|
||||
true);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (!short_form) {
|
||||
|
|
@ -576,7 +576,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
printf("%s has no %s record\n", namestr, typestr);
|
||||
}
|
||||
seen_error = force_error;
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char *optstring = "46aAc:dilnm:p:rst:vVwCDN:R:TUW:";
|
||||
|
|
@ -928,5 +928,5 @@ main(int argc, char **argv) {
|
|||
cancel_all();
|
||||
destroy_libs();
|
||||
isc_app_finish();
|
||||
return ((seen_error == 0) ? 0 : 1);
|
||||
return (seen_error == 0) ? 0 : 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ rcode_totext(dns_rcode_t rcode) {
|
|||
} else {
|
||||
totext.consttext = rcodetext[rcode];
|
||||
}
|
||||
return (totext.deconsttext);
|
||||
return totext.deconsttext;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -225,9 +225,9 @@ printsection(dig_query_t *query, dns_message_t *msg, bool headers,
|
|||
|
||||
result = dns_message_firstname(msg, section);
|
||||
if (result == ISC_R_NOMORE) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
for (;;) {
|
||||
name = NULL;
|
||||
|
|
@ -271,10 +271,10 @@ printsection(dig_query_t *query, dns_message_t *msg, bool headers,
|
|||
if (result == ISC_R_NOMORE) {
|
||||
break;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -309,9 +309,9 @@ detailsection(dig_query_t *query, dns_message_t *msg, bool headers,
|
|||
|
||||
result = dns_message_firstname(msg, section);
|
||||
if (result == ISC_R_NOMORE) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
for (;;) {
|
||||
name = NULL;
|
||||
|
|
@ -353,10 +353,10 @@ detailsection(dig_query_t *query, dns_message_t *msg, bool headers,
|
|||
if (result == ISC_R_NOMORE) {
|
||||
break;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -440,7 +440,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
|
||||
/* the lookup failed */
|
||||
print_error |= 1;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (default_lookups && query->lookup->rdtype == dns_rdatatype_a) {
|
||||
|
|
@ -494,7 +494,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
printsection(query, msg, headers, DNS_SECTION_AUTHORITY);
|
||||
printsection(query, msg, headers, DNS_SECTION_ADDITIONAL);
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -553,10 +553,10 @@ testtype(char *typetext) {
|
|||
tr.length = strlen(typetext);
|
||||
result = dns_rdatatype_fromtext(&rdtype, &tr);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
return (true);
|
||||
return true;
|
||||
} else {
|
||||
printf("unknown query type: %s\n", typetext);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -570,10 +570,10 @@ testclass(char *typetext) {
|
|||
tr.length = strlen(typetext);
|
||||
result = dns_rdataclass_fromtext(&rdclass, &tr);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
return (true);
|
||||
return true;
|
||||
} else {
|
||||
printf("unknown query class: %s\n", typetext);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -974,5 +974,5 @@ main(int argc, char **argv) {
|
|||
destroy_libs();
|
||||
isc_app_finish();
|
||||
|
||||
return (query_error | print_error);
|
||||
return query_error | print_error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ readline(const char *prompt) {
|
|||
line = fgets(buf, RL_MAXCMD, stdin);
|
||||
if (line == NULL) {
|
||||
free(buf);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
return (buf);
|
||||
};
|
||||
return buf;
|
||||
}
|
||||
|
||||
#define add_history(line)
|
||||
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ formatset(dns_rdataset_t *rdataset) {
|
|||
}
|
||||
|
||||
isc_buffer_putuint8(buf, 0);
|
||||
return (buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -507,14 +507,14 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness) {
|
|||
vbprintf(1, "found matching %s %d %d %d\n",
|
||||
c ? "CDS" : "DS", ds.key_tag, ds.algorithm,
|
||||
ds.digest_type);
|
||||
return (true);
|
||||
return true;
|
||||
} else if (strictness == TIGHT) {
|
||||
vbprintf(0,
|
||||
"key does not match %s %d %d %d "
|
||||
"when it looks like it should\n",
|
||||
c ? "CDS" : "DS", ds.key_tag, ds.algorithm,
|
||||
ds.digest_type);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness) {
|
|||
ki->rdata.type == dns_rdatatype_cdnskey ? "CDNSKEY" : "DNSKEY",
|
||||
ki->tag, ki->algo);
|
||||
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -577,7 +577,7 @@ match_keyset_dsset(dns_rdataset_t *keyset, dns_rdataset_t *dsset,
|
|||
}
|
||||
}
|
||||
|
||||
return (keytable);
|
||||
return keytable;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -684,7 +684,7 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
|
|||
}
|
||||
}
|
||||
|
||||
return (algo);
|
||||
return algo;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -701,7 +701,7 @@ signed_loose(dns_secalg_t *algo) {
|
|||
}
|
||||
}
|
||||
isc_mem_put(mctx, algo, nkey);
|
||||
return (ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -743,7 +743,7 @@ signed_strict(dns_rdataset_t *dsset, dns_secalg_t *algo) {
|
|||
}
|
||||
|
||||
isc_mem_put(mctx, algo, nkey);
|
||||
return (all_ok);
|
||||
return all_ok;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -764,10 +764,10 @@ ds_from_cds(isc_buffer_t *buf, dns_rdata_t *rds, dns_dsdigest_t dt,
|
|||
ds.common.rdtype = dns_rdatatype_ds;
|
||||
|
||||
if (ds.digest_type != dt) {
|
||||
return (ISC_R_IGNORE);
|
||||
return ISC_R_IGNORE;
|
||||
}
|
||||
|
||||
return (dns_rdata_fromstruct(rds, rdclass, dns_rdatatype_ds, &ds, buf));
|
||||
return dns_rdata_fromstruct(rds, rdclass, dns_rdatatype_ds, &ds, buf);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -780,7 +780,7 @@ ds_from_cdnskey(isc_buffer_t *buf, dns_rdata_t *ds, dns_dsdigest_t dt,
|
|||
|
||||
isc_buffer_availableregion(buf, &r);
|
||||
if (r.length < DNS_DS_BUFFERSIZE) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
|
||||
result = dns_ds_buildrdata(name, cdnskey, dt, r.base, ds);
|
||||
|
|
@ -788,7 +788,7 @@ ds_from_cdnskey(isc_buffer_t *buf, dns_rdata_t *ds, dns_dsdigest_t dt,
|
|||
isc_buffer_add(buf, DNS_DS_BUFFERSIZE);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -819,14 +819,14 @@ append_new_ds_set(ds_maker_func_t *ds_from_rdata, isc_buffer_t *buf,
|
|||
continue;
|
||||
case ISC_R_NOSPACE:
|
||||
isc_mem_put(mctx, ds, sizeof(*ds));
|
||||
return (result);
|
||||
return result;
|
||||
default:
|
||||
isc_mem_put(mctx, ds, sizeof(*ds));
|
||||
check_result(result, "ds_from_rdata()");
|
||||
}
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -871,8 +871,8 @@ make_new_ds_set(ds_maker_func_t *ds_from_rdata, uint32_t ttl,
|
|||
|
||||
static int
|
||||
rdata_cmp(const void *rdata1, const void *rdata2) {
|
||||
return (dns_rdata_compare((const dns_rdata_t *)rdata1,
|
||||
(const dns_rdata_t *)rdata2));
|
||||
return dns_rdata_compare((const dns_rdata_t *)rdata1,
|
||||
(const dns_rdata_t *)rdata2);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -953,7 +953,7 @@ consistent_digests(dns_rdataset_t *dsset) {
|
|||
isc_mem_put(mctx, ds, n * sizeof(dns_rdata_ds_t));
|
||||
isc_mem_put(mctx, arrdata, n * sizeof(dns_rdata_t));
|
||||
|
||||
return (match);
|
||||
return match;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1358,5 +1358,5 @@ cleanup:
|
|||
print_mem_stats = true;
|
||||
cleanup();
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ initname(char *setname) {
|
|||
isc_buffer_init(&buf, setname, strlen(setname));
|
||||
isc_buffer_add(&buf, strlen(setname));
|
||||
result = dns_name_fromtext(name, &buf, dns_rootname, 0, NULL);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -138,7 +138,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
|
|||
if (db != NULL) {
|
||||
dns_db_detach(&db);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -153,7 +153,7 @@ loadkeyset(char *dirname, dns_rdataset_t *rdataset) {
|
|||
if (dirname != NULL) {
|
||||
/* allow room for a trailing slash */
|
||||
if (strlen(dirname) >= isc_buffer_availablelength(&buf)) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
isc_buffer_putstr(&buf, dirname);
|
||||
if (dirname[strlen(dirname) - 1] != '/') {
|
||||
|
|
@ -162,18 +162,18 @@ loadkeyset(char *dirname, dns_rdataset_t *rdataset) {
|
|||
}
|
||||
|
||||
if (isc_buffer_availablelength(&buf) < 7) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
isc_buffer_putstr(&buf, "keyset-");
|
||||
|
||||
result = dns_name_tofilenametext(name, false, &buf);
|
||||
check_result(result, "dns_name_tofilenametext()");
|
||||
if (isc_buffer_availablelength(&buf) == 0) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
isc_buffer_putuint8(&buf, 0);
|
||||
|
||||
return (loadset(filename, rdataset));
|
||||
return loadset(filename, rdataset);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -554,8 +554,8 @@ main(int argc, char **argv) {
|
|||
fflush(stdout);
|
||||
if (ferror(stdout)) {
|
||||
fprintf(stderr, "write error\n");
|
||||
return (1);
|
||||
return 1;
|
||||
} else {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ initname(char *setname) {
|
|||
isc_buffer_init(&buf, setname, strlen(setname));
|
||||
isc_buffer_add(&buf, strlen(setname));
|
||||
result = dns_name_fromtext(name, &buf, dns_rootname, 0, NULL);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -142,7 +142,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
|
|||
if (db != NULL) {
|
||||
dns_db_detach(&db);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -470,8 +470,8 @@ main(int argc, char **argv) {
|
|||
fflush(stdout);
|
||||
if (ferror(stdout)) {
|
||||
fprintf(stderr, "write error\n");
|
||||
return (1);
|
||||
return 1;
|
||||
} else {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -756,5 +756,5 @@ main(int argc, char **argv) {
|
|||
free(freeit);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1288,5 +1288,5 @@ main(int argc, char **argv) {
|
|||
free(freeit);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,5 +259,5 @@ cleanup:
|
|||
}
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -963,5 +963,5 @@ main(int argc, char **argv) {
|
|||
isc_mem_free(mctx, directory);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ savezonecut(dns_fixedname_t *fzonecut, dns_name_t *name) {
|
|||
result = dns_fixedname_initname(fzonecut);
|
||||
dns_name_copy(name, result);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -325,28 +325,28 @@ signwithkey(dns_name_t *name, dns_rdataset_t *rdataset, dst_key_t *key,
|
|||
|
||||
static bool
|
||||
issigningkey(dns_dnsseckey_t *key) {
|
||||
return (key->force_sign || key->hint_sign);
|
||||
return key->force_sign || key->hint_sign;
|
||||
}
|
||||
|
||||
static bool
|
||||
ispublishedkey(dns_dnsseckey_t *key) {
|
||||
return ((key->force_publish || key->hint_publish) && !key->hint_remove);
|
||||
return (key->force_publish || key->hint_publish) && !key->hint_remove;
|
||||
}
|
||||
|
||||
static bool
|
||||
iszonekey(dns_dnsseckey_t *key) {
|
||||
return (dns_name_equal(dst_key_name(key->key), gorigin) &&
|
||||
dst_key_iszonekey(key->key));
|
||||
return dns_name_equal(dst_key_name(key->key), gorigin) &&
|
||||
dst_key_iszonekey(key->key);
|
||||
}
|
||||
|
||||
static bool
|
||||
isksk(dns_dnsseckey_t *key) {
|
||||
return (key->ksk);
|
||||
return key->ksk;
|
||||
}
|
||||
|
||||
static bool
|
||||
iszsk(dns_dnsseckey_t *key) {
|
||||
return (ignore_kskflag || !key->ksk);
|
||||
return ignore_kskflag || !key->ksk;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -366,10 +366,10 @@ keythatsigned_unlocked(dns_rdata_rrsig_t *rrsig) {
|
|||
rrsig->algorithm == dst_key_alg(key->key) &&
|
||||
dns_name_equal(&rrsig->signer, dst_key_name(key->key)))
|
||||
{
|
||||
return (key);
|
||||
return key;
|
||||
}
|
||||
}
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -386,7 +386,7 @@ keythatsigned(dns_rdata_rrsig_t *rrsig) {
|
|||
key = keythatsigned_unlocked(rrsig);
|
||||
RWUNLOCK(&keylist_lock, isc_rwlocktype_read);
|
||||
if (key != NULL) {
|
||||
return (key);
|
||||
return key;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -400,7 +400,7 @@ keythatsigned(dns_rdata_rrsig_t *rrsig) {
|
|||
key = keythatsigned_unlocked(rrsig);
|
||||
if (key != NULL) {
|
||||
isc_rwlock_unlock(&keylist_lock, isc_rwlocktype_write);
|
||||
return (key);
|
||||
return key;
|
||||
}
|
||||
|
||||
result = dst_key_fromfile(&rrsig->signer, rrsig->keyid,
|
||||
|
|
@ -408,7 +408,7 @@ keythatsigned(dns_rdata_rrsig_t *rrsig) {
|
|||
mctx, &pubkey);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_rwlock_unlock(&keylist_lock, isc_rwlocktype_write);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result = dst_key_fromfile(
|
||||
|
|
@ -429,7 +429,7 @@ keythatsigned(dns_rdata_rrsig_t *rrsig) {
|
|||
}
|
||||
|
||||
isc_rwlock_unlock(&keylist_lock, isc_rwlocktype_write);
|
||||
return (key);
|
||||
return key;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -451,11 +451,11 @@ expecttofindkey(dns_name_t *name) {
|
|||
case ISC_R_SUCCESS:
|
||||
case DNS_R_NXDOMAIN:
|
||||
case DNS_R_NXRRSET:
|
||||
return (true);
|
||||
return true;
|
||||
case DNS_R_DELEGATION:
|
||||
case DNS_R_CNAME:
|
||||
case DNS_R_DNAME:
|
||||
return (false);
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -463,7 +463,7 @@ expecttofindkey(dns_name_t *name) {
|
|||
fatal("failure looking for '%s DNSKEY' in database: %s", namestr,
|
||||
isc_result_totext(result));
|
||||
UNREACHABLE();
|
||||
return (false); /* removes a warning */
|
||||
return false; /* removes a warning */
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -473,10 +473,10 @@ setverifies(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
|||
result = dns_dnssec_verify(name, set, key, false, 0, mctx, rrsig, NULL);
|
||||
if (result == ISC_R_SUCCESS || result == DNS_R_FROMWILDCARD) {
|
||||
INCSTAT(nverified);
|
||||
return (true);
|
||||
return true;
|
||||
} else {
|
||||
INCSTAT(nverifyfailed);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -861,7 +861,7 @@ hashlist_add_dns_name(hashlist_t *l,
|
|||
|
||||
static int
|
||||
hashlist_comp(const void *a, const void *b) {
|
||||
return (memcmp(a, b, hash_length + 1));
|
||||
return memcmp(a, b, hash_length + 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -893,11 +893,11 @@ hashlist_hasdup(hashlist_t *l) {
|
|||
continue;
|
||||
}
|
||||
if (isc_safe_memequal(current, next, l->length - 1)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
current = next;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
static const unsigned char *
|
||||
|
|
@ -919,16 +919,16 @@ hashlist_findnext(const hashlist_t *l,
|
|||
}
|
||||
} while (entries-- > 1U);
|
||||
INSIST(entries != 0U);
|
||||
return (next);
|
||||
return next;
|
||||
}
|
||||
|
||||
static bool
|
||||
hashlist_exists(const hashlist_t *l,
|
||||
const unsigned char hash[NSEC3_MAX_HASH_LENGTH]) {
|
||||
if (bsearch(hash, l->hashbuf, l->entries, l->length, hashlist_comp)) {
|
||||
return (true);
|
||||
return true;
|
||||
} else {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1037,7 +1037,7 @@ loadds(dns_name_t *name, uint32_t ttl, dns_rdataset_t *dsset) {
|
|||
vbprintf(2, "found DS records\n");
|
||||
dsset->ttl = ttl;
|
||||
dns_db_detach(&db);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
dns_db_detach(&db);
|
||||
|
|
@ -1046,13 +1046,13 @@ loadds(dns_name_t *name, uint32_t ttl, dns_rdataset_t *dsset) {
|
|||
/* No DS records found; try again, looking for DNSKEY records */
|
||||
opendb("keyset-", name, gclass, &db);
|
||||
if (db == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
result = dns_db_findnode(db, name, false, &node);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_db_detach(&db);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
dns_rdataset_init(&keyset);
|
||||
|
|
@ -1061,7 +1061,7 @@ loadds(dns_name_t *name, uint32_t ttl, dns_rdataset_t *dsset) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
dns_db_detachnode(db, &node);
|
||||
dns_db_detach(&db);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
vbprintf(2, "found DNSKEY records\n");
|
||||
|
||||
|
|
@ -1098,7 +1098,7 @@ loadds(dns_name_t *name, uint32_t ttl, dns_rdataset_t *dsset) {
|
|||
dns_rdataset_disassociate(&keyset);
|
||||
dns_db_detachnode(db, &node);
|
||||
dns_db_detach(&db);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -1107,7 +1107,7 @@ secure(dns_name_t *name, dns_dbnode_t *node) {
|
|||
isc_result_t result;
|
||||
|
||||
if (dns_name_equal(name, gorigin)) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
dns_rdataset_init(&dsset);
|
||||
|
|
@ -1117,7 +1117,7 @@ secure(dns_name_t *name, dns_dbnode_t *node) {
|
|||
dns_rdataset_disassociate(&dsset);
|
||||
}
|
||||
|
||||
return (result == ISC_R_SUCCESS);
|
||||
return result == ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -1127,7 +1127,7 @@ is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
|
|||
isc_result_t result;
|
||||
|
||||
if (dns_name_equal(name, origin)) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
dns_rdataset_init(&nsset);
|
||||
|
|
@ -1140,7 +1140,7 @@ is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
|
|||
dns_rdataset_disassociate(&nsset);
|
||||
}
|
||||
|
||||
return ((result == ISC_R_SUCCESS));
|
||||
return result == ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -1159,7 +1159,7 @@ has_dname(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node) {
|
|||
dns_rdataset_disassociate(&dnameset);
|
||||
}
|
||||
|
||||
return ((result == ISC_R_SUCCESS));
|
||||
return result == ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -1377,7 +1377,7 @@ active_node(dns_dbnode_t *node) {
|
|||
}
|
||||
dns_rdatasetiter_destroy(&rdsiter);
|
||||
|
||||
return (active);
|
||||
return active;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -1426,7 +1426,7 @@ setsoaserial(uint32_t serial, dns_updatemethod_t method) {
|
|||
|
||||
result = dns_db_getoriginnode(gdb, &node);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
dns_rdataset_init(&rdataset);
|
||||
|
|
@ -1500,7 +1500,7 @@ cleanup:
|
|||
}
|
||||
dns_rdata_reset(&rdata);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -4159,5 +4159,5 @@ main(int argc, char *argv[]) {
|
|||
&sign_finish);
|
||||
}
|
||||
|
||||
return (vresult == ISC_R_SUCCESS ? 0 : 1);
|
||||
return vresult == ISC_R_SUCCESS ? 0 : 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -341,5 +341,5 @@ main(int argc, char *argv[]) {
|
|||
|
||||
(void)isc_app_finish();
|
||||
|
||||
return (result == ISC_R_SUCCESS ? 0 : 1);
|
||||
return result == ISC_R_SUCCESS ? 0 : 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,16 +200,16 @@ time_units(isc_stdtime_t offset, char *suffix, const char *str) {
|
|||
switch (suffix[0]) {
|
||||
case 'Y':
|
||||
case 'y':
|
||||
return (offset * (365 * 24 * 3600));
|
||||
return offset * (365 * 24 * 3600);
|
||||
case 'M':
|
||||
case 'm':
|
||||
switch (suffix[1]) {
|
||||
case 'O':
|
||||
case 'o':
|
||||
return (offset * (30 * 24 * 3600));
|
||||
return offset * (30 * 24 * 3600);
|
||||
case 'I':
|
||||
case 'i':
|
||||
return (offset * 60);
|
||||
return offset * 60;
|
||||
case '\0':
|
||||
fatal("'%s' ambiguous: use 'mi' for minutes "
|
||||
"or 'mo' for months",
|
||||
|
|
@ -221,29 +221,29 @@ time_units(isc_stdtime_t offset, char *suffix, const char *str) {
|
|||
break;
|
||||
case 'W':
|
||||
case 'w':
|
||||
return (offset * (7 * 24 * 3600));
|
||||
return offset * (7 * 24 * 3600);
|
||||
case 'D':
|
||||
case 'd':
|
||||
return (offset * (24 * 3600));
|
||||
return offset * (24 * 3600);
|
||||
case 'H':
|
||||
case 'h':
|
||||
return (offset * 3600);
|
||||
return offset * 3600;
|
||||
case 'S':
|
||||
case 's':
|
||||
case '\0':
|
||||
return (offset);
|
||||
return offset;
|
||||
default:
|
||||
fatal("time value %s is invalid", str);
|
||||
}
|
||||
UNREACHABLE();
|
||||
return (0); /* silence compiler warning */
|
||||
return 0; /* silence compiler warning */
|
||||
}
|
||||
|
||||
static bool
|
||||
isnone(const char *str) {
|
||||
return ((strcasecmp(str, "none") == 0) ||
|
||||
(strcasecmp(str, "never") == 0) ||
|
||||
(strcasecmp(str, "unset") == 0));
|
||||
return (strcasecmp(str, "none") == 0) ||
|
||||
(strcasecmp(str, "never") == 0) ||
|
||||
(strcasecmp(str, "unset") == 0);
|
||||
}
|
||||
|
||||
dns_ttl_t
|
||||
|
|
@ -253,7 +253,7 @@ strtottl(const char *str) {
|
|||
char *endp;
|
||||
|
||||
if (isnone(str)) {
|
||||
return ((dns_ttl_t)0);
|
||||
return (dns_ttl_t)0;
|
||||
}
|
||||
|
||||
ttl = strtol(str, &endp, 0);
|
||||
|
|
@ -261,19 +261,19 @@ strtottl(const char *str) {
|
|||
fatal("TTL must be numeric");
|
||||
}
|
||||
ttl = time_units(ttl, endp, orig);
|
||||
return (ttl);
|
||||
return ttl;
|
||||
}
|
||||
|
||||
dst_key_state_t
|
||||
strtokeystate(const char *str) {
|
||||
if (isnone(str)) {
|
||||
return (DST_KEY_STATE_NA);
|
||||
return DST_KEY_STATE_NA;
|
||||
}
|
||||
|
||||
for (int i = 0; i < KEYSTATES_NVALUES; i++) {
|
||||
if (keystates[i] != NULL && strcasecmp(str, keystates[i]) == 0)
|
||||
{
|
||||
return ((dst_key_state_t)i);
|
||||
return (dst_key_state_t)i;
|
||||
}
|
||||
}
|
||||
fatal("unknown key state %s", str);
|
||||
|
|
@ -292,7 +292,7 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) {
|
|||
if (setp != NULL) {
|
||||
*setp = false;
|
||||
}
|
||||
return ((isc_stdtime_t)0);
|
||||
return (isc_stdtime_t)0;
|
||||
}
|
||||
|
||||
if (setp != NULL) {
|
||||
|
|
@ -300,7 +300,7 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) {
|
|||
}
|
||||
|
||||
if ((str[0] == '0' || str[0] == '-') && str[1] == '\0') {
|
||||
return ((isc_stdtime_t)0);
|
||||
return (isc_stdtime_t)0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -349,7 +349,7 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) {
|
|||
}
|
||||
|
||||
if (str[0] == '\0') {
|
||||
return ((isc_stdtime_t)base);
|
||||
return (isc_stdtime_t)base;
|
||||
} else if (str[0] == '+') {
|
||||
offset = strtol(str + 1, &endp, 0);
|
||||
offset = time_units((isc_stdtime_t)offset, endp, orig);
|
||||
|
|
@ -362,7 +362,7 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) {
|
|||
fatal("time value %s is invalid", orig);
|
||||
}
|
||||
|
||||
return ((isc_stdtime_t)val);
|
||||
return (isc_stdtime_t)val;
|
||||
}
|
||||
|
||||
dns_rdataclass_t
|
||||
|
|
@ -372,7 +372,7 @@ strtoclass(const char *str) {
|
|||
isc_result_t result;
|
||||
|
||||
if (str == NULL) {
|
||||
return (dns_rdataclass_in);
|
||||
return dns_rdataclass_in;
|
||||
}
|
||||
DE_CONST(str, r.base);
|
||||
r.length = strlen(str);
|
||||
|
|
@ -380,7 +380,7 @@ strtoclass(const char *str) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("unknown class %s", str);
|
||||
}
|
||||
return (rdclass);
|
||||
return rdclass;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
|
|
@ -395,14 +395,14 @@ strtodsdigest(const char *str) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("unknown DS algorithm %s", str);
|
||||
}
|
||||
return (alg);
|
||||
return alg;
|
||||
}
|
||||
|
||||
static int
|
||||
cmp_dtype(const void *ap, const void *bp) {
|
||||
int a = *(const uint8_t *)ap;
|
||||
int b = *(const uint8_t *)bp;
|
||||
return (a - b);
|
||||
return a - b;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -434,7 +434,7 @@ try_dir(const char *dirname) {
|
|||
if (result == ISC_R_SUCCESS) {
|
||||
isc_dir_close(&d);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -512,16 +512,16 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
|||
result = dst_key_buildfilename(dstkey, DST_TYPE_PRIVATE, dir,
|
||||
&fileb);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (isc_file_exists(filename));
|
||||
return isc_file_exists(filename);
|
||||
}
|
||||
|
||||
ISC_LIST_INIT(matchkeys);
|
||||
isc_stdtime_get(&now);
|
||||
result = dns_dnssec_findmatchingkeys(name, dir, now, mctx, &matchkeys);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
while (!ISC_LIST_EMPTY(matchkeys) && !conflict) {
|
||||
|
|
@ -565,7 +565,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
|||
dns_dnsseckey_destroy(mctx, &key);
|
||||
}
|
||||
|
||||
return (conflict);
|
||||
return conflict;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -580,7 +580,7 @@ isoptarg(const char *arg, char **argv, void (*usage)(void)) {
|
|||
isc_commandline_argument = argv[isc_commandline_index];
|
||||
/* skip to next argument */
|
||||
isc_commandline_index++;
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ dns64_rdata(unsigned char *v, size_t start, unsigned char *rdata) {
|
|||
}
|
||||
}
|
||||
memmove(&rdata[j], "\07in-addr\04arpa", 14);
|
||||
return (j + 14);
|
||||
return j + 14;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -149,7 +149,7 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
zlen = zone->length;
|
||||
nlen = name->length;
|
||||
if ((zlen + nlen) > 74U || zlen < 10U || (nlen % 2) != 0U) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -175,11 +175,11 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
while (j != 0U) {
|
||||
INSIST((i / 2) < sizeof(v));
|
||||
if (ndata[0] != 1) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
n = hex16[ndata[1] & 0xff];
|
||||
if (n == 1) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
v[i / 2] = n | (v[i / 2] >> 4);
|
||||
j -= 2;
|
||||
|
|
@ -201,14 +201,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
* to exist in the zone.
|
||||
*/
|
||||
if (nlen > 16U && v[(nlen - 1) / 4 - 4] != 0) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
/*
|
||||
* If the total length is not 74 then this is a empty node
|
||||
* so return success.
|
||||
*/
|
||||
if (nlen + zlen != 74U) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
len = dns64_rdata(v, 8, rdata);
|
||||
break;
|
||||
|
|
@ -218,14 +218,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
* to exist in the zone.
|
||||
*/
|
||||
if (nlen > 12U && v[(nlen - 1) / 4 - 3] != 0) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
/*
|
||||
* If the total length is not 74 then this is a empty node
|
||||
* so return success.
|
||||
*/
|
||||
if (nlen + zlen != 74U) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
len = dns64_rdata(v, 6, rdata);
|
||||
break;
|
||||
|
|
@ -235,14 +235,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
* to exist in the zone.
|
||||
*/
|
||||
if (nlen > 8U && v[(nlen - 1) / 4 - 2] != 0) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
/*
|
||||
* If the total length is not 74 then this is a empty node
|
||||
* so return success.
|
||||
*/
|
||||
if (nlen + zlen != 74U) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
len = dns64_rdata(v, 5, rdata);
|
||||
break;
|
||||
|
|
@ -252,14 +252,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
* to exist in the zone.
|
||||
*/
|
||||
if (nlen > 4U && v[(nlen - 1) / 4 - 1] != 0) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
/*
|
||||
* If the total length is not 74 then this is a empty node
|
||||
* so return success.
|
||||
*/
|
||||
if (nlen + zlen != 74U) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
len = dns64_rdata(v, 4, rdata);
|
||||
break;
|
||||
|
|
@ -269,14 +269,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
* to exist in the zone.
|
||||
*/
|
||||
if (v[(nlen - 1) / 4] != 0) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
/*
|
||||
* If the total length is not 74 then this is a empty node
|
||||
* so return success.
|
||||
*/
|
||||
if (nlen + zlen != 74U) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
len = dns64_rdata(v, 3, rdata);
|
||||
break;
|
||||
|
|
@ -286,7 +286,7 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
* so return success.
|
||||
*/
|
||||
if (nlen + zlen != 74U) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
len = dns64_rdata(v, 0, rdata);
|
||||
break;
|
||||
|
|
@ -295,7 +295,7 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
* This should never be reached unless someone adds a
|
||||
* zone declaration with this internal type to named.conf.
|
||||
*/
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -304,12 +304,12 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
if ((v[0] == 170 || v[0] == 171) && v[1] == 0 && v[2] == 0 &&
|
||||
v[3] == 192)
|
||||
{
|
||||
return (dns_sdb_putrdata(lookup, dns_rdatatype_ptr, 3600,
|
||||
ipv4only, sizeof(ipv4only)));
|
||||
return dns_sdb_putrdata(lookup, dns_rdatatype_ptr, 3600,
|
||||
ipv4only, sizeof(ipv4only));
|
||||
}
|
||||
|
||||
return (dns_sdb_putrdata(lookup, dns_rdatatype_cname, 600, rdata,
|
||||
(unsigned int)len));
|
||||
return dns_sdb_putrdata(lookup, dns_rdatatype_cname, 600, rdata,
|
||||
(unsigned int)len);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -323,9 +323,9 @@ builtin_lookup(const char *zone, const char *name, void *dbdata,
|
|||
UNUSED(clientinfo);
|
||||
|
||||
if (strcmp(name, "@") == 0) {
|
||||
return (b->do_lookup(lookup));
|
||||
return b->do_lookup(lookup);
|
||||
} else {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -339,9 +339,9 @@ dns64_lookup(const dns_name_t *zone, const dns_name_t *name, void *dbdata,
|
|||
UNUSED(clientinfo);
|
||||
|
||||
if (name->labels == 0 && name->length == 0) {
|
||||
return (b->do_lookup(lookup));
|
||||
return b->do_lookup(lookup);
|
||||
} else {
|
||||
return (dns64_cname(zone, name, lookup));
|
||||
return dns64_cname(zone, name, lookup);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -354,19 +354,19 @@ put_txt(dns_sdblookup_t *lookup, const char *text) {
|
|||
}
|
||||
buf[0] = len;
|
||||
memmove(&buf[1], text, len);
|
||||
return (dns_sdb_putrdata(lookup, dns_rdatatype_txt, 0, buf, len + 1));
|
||||
return dns_sdb_putrdata(lookup, dns_rdatatype_txt, 0, buf, len + 1);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
do_version_lookup(dns_sdblookup_t *lookup) {
|
||||
if (named_g_server->version_set) {
|
||||
if (named_g_server->version == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
return (put_txt(lookup, named_g_server->version));
|
||||
return put_txt(lookup, named_g_server->version);
|
||||
}
|
||||
} else {
|
||||
return (put_txt(lookup, PACKAGE_VERSION));
|
||||
return put_txt(lookup, PACKAGE_VERSION);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -374,16 +374,16 @@ static isc_result_t
|
|||
do_hostname_lookup(dns_sdblookup_t *lookup) {
|
||||
if (named_g_server->hostname_set) {
|
||||
if (named_g_server->hostname == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
return (put_txt(lookup, named_g_server->hostname));
|
||||
return put_txt(lookup, named_g_server->hostname);
|
||||
}
|
||||
} else {
|
||||
char buf[256];
|
||||
if (gethostname(buf, sizeof(buf)) != 0) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
return (put_txt(lookup, buf));
|
||||
return put_txt(lookup, buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -405,16 +405,16 @@ do_authors_lookup(dns_sdblookup_t *lookup) {
|
|||
* If a version string is specified, disable the authors.bind zone.
|
||||
*/
|
||||
if (named_g_server->version_set) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
for (p = authors; *p != NULL; p++) {
|
||||
result = put_txt(lookup, *p);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -422,26 +422,26 @@ do_id_lookup(dns_sdblookup_t *lookup) {
|
|||
if (named_g_server->sctx->usehostname) {
|
||||
char buf[256];
|
||||
if (gethostname(buf, sizeof(buf)) != 0) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
return (put_txt(lookup, buf));
|
||||
return put_txt(lookup, buf);
|
||||
} else if (named_g_server->sctx->server_id != NULL) {
|
||||
return (put_txt(lookup, named_g_server->sctx->server_id));
|
||||
return put_txt(lookup, named_g_server->sctx->server_id);
|
||||
} else {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
do_dns64_lookup(dns_sdblookup_t *lookup) {
|
||||
UNUSED(lookup);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
do_empty_lookup(dns_sdblookup_t *lookup) {
|
||||
UNUSED(lookup);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -453,10 +453,10 @@ do_ipv4only_lookup(dns_sdblookup_t *lookup) {
|
|||
result = dns_sdb_putrdata(lookup, dns_rdatatype_a, 3600,
|
||||
data[i], 4);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -465,7 +465,7 @@ do_ipv4reverse_lookup(dns_sdblookup_t *lookup) {
|
|||
|
||||
result = dns_sdb_putrdata(lookup, dns_rdatatype_ptr, 3600, ipv4only,
|
||||
sizeof(ipv4only));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -492,15 +492,15 @@ builtin_authority(const char *zone, void *dbdata, dns_sdblookup_t *lookup) {
|
|||
|
||||
result = dns_sdb_putsoa(lookup, server, contact, 0);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = dns_sdb_putrr(lookup, "ns", 0, server);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -516,10 +516,10 @@ builtin_create(const char *zone, int argc, char **argv, void *driverdata,
|
|||
strcmp(argv[0], "ipv4reverse") == 0)
|
||||
{
|
||||
if (argc != 3) {
|
||||
return (DNS_R_SYNTAX);
|
||||
return DNS_R_SYNTAX;
|
||||
}
|
||||
} else if (argc != 1) {
|
||||
return (DNS_R_SYNTAX);
|
||||
return DNS_R_SYNTAX;
|
||||
}
|
||||
|
||||
if (strcmp(argv[0], "authors") == 0) {
|
||||
|
|
@ -540,7 +540,7 @@ builtin_create(const char *zone, int argc, char **argv, void *driverdata,
|
|||
char *contact;
|
||||
|
||||
if (argc != 3) {
|
||||
return (DNS_R_SYNTAX);
|
||||
return DNS_R_SYNTAX;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -589,9 +589,9 @@ builtin_create(const char *zone, int argc, char **argv, void *driverdata,
|
|||
*dbdata = empty;
|
||||
}
|
||||
} else {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -640,7 +640,7 @@ named_builtin_init(void) {
|
|||
DNS_SDBFLAG_DNS64,
|
||||
named_g_mctx,
|
||||
&dns64_impl) == ISC_R_SUCCESS);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -364,13 +364,13 @@ named_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf) {
|
|||
|
||||
isc_buffer_init(&b, defaultconf, sizeof(defaultconf) - 1);
|
||||
isc_buffer_add(&b, sizeof(defaultconf) - 1);
|
||||
return (cfg_parse_buffer(parser, &b, __FILE__, 0, &cfg_type_namedconf,
|
||||
CFG_PCTX_NODEPRECATED, conf));
|
||||
return cfg_parse_buffer(parser, &b, __FILE__, 0, &cfg_type_namedconf,
|
||||
CFG_PCTX_NODEPRECATED, conf);
|
||||
}
|
||||
|
||||
const char *
|
||||
named_config_getdefault(void) {
|
||||
return (defaultconf);
|
||||
return defaultconf;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -380,10 +380,10 @@ named_config_get(cfg_obj_t const *const *maps, const char *name,
|
|||
|
||||
for (i = 0; maps[i] != NULL; i++) {
|
||||
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -409,7 +409,7 @@ named_checknames_get(const cfg_obj_t **maps, const char *const names[],
|
|||
*/
|
||||
if (checknames != NULL && !cfg_obj_islist(checknames)) {
|
||||
*obj = checknames;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
for (element = cfg_list_first(checknames);
|
||||
element != NULL; element = cfg_list_next(element))
|
||||
|
|
@ -423,13 +423,13 @@ named_checknames_get(const cfg_obj_t **maps, const char *const names[],
|
|||
{
|
||||
*obj = cfg_tuple_get(value,
|
||||
"mode");
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -441,7 +441,7 @@ named_config_listcount(const cfg_obj_t *list) {
|
|||
i++;
|
||||
}
|
||||
|
||||
return (i);
|
||||
return i;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -452,7 +452,7 @@ named_config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
|
|||
|
||||
if (!cfg_obj_isstring(classobj)) {
|
||||
*classp = defclass;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
DE_CONST(cfg_obj_asstring(classobj), r.base);
|
||||
r.length = strlen(r.base);
|
||||
|
|
@ -461,7 +461,7 @@ named_config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
|
|||
cfg_obj_log(classobj, named_g_lctx, ISC_LOG_ERROR,
|
||||
"unknown class '%s'", r.base);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -472,7 +472,7 @@ named_config_gettype(const cfg_obj_t *typeobj, dns_rdatatype_t deftype,
|
|||
|
||||
if (!cfg_obj_isstring(typeobj)) {
|
||||
*typep = deftype;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
DE_CONST(cfg_obj_asstring(typeobj), r.base);
|
||||
r.length = strlen(r.base);
|
||||
|
|
@ -481,7 +481,7 @@ named_config_gettype(const cfg_obj_t *typeobj, dns_rdatatype_t deftype,
|
|||
cfg_obj_log(typeobj, named_g_lctx, ISC_LOG_ERROR,
|
||||
"unknown type '%s'", r.base);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
dns_zonetype_t
|
||||
|
|
@ -507,7 +507,7 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
|
|||
} else {
|
||||
UNREACHABLE();
|
||||
}
|
||||
return (ztype);
|
||||
return ztype;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -534,7 +534,7 @@ named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
|
|||
if (val > UINT16_MAX) {
|
||||
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
|
||||
"port '%u' out of range", val);
|
||||
return (ISC_R_RANGE);
|
||||
return ISC_R_RANGE;
|
||||
}
|
||||
port = (in_port_t)val;
|
||||
} else if (defport != 0) {
|
||||
|
|
@ -542,7 +542,7 @@ named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
|
|||
} else {
|
||||
result = named_config_getport(config, "port", &port);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -564,7 +564,7 @@ named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
|
|||
*addrsp = addrs;
|
||||
*countp = count;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -589,7 +589,7 @@ getremotesdef(const cfg_obj_t *cctx, const char *list, const char *name,
|
|||
|
||||
result = cfg_map_get(cctx, list, &obj);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
elt = cfg_list_first(obj);
|
||||
while (elt != NULL) {
|
||||
|
|
@ -598,11 +598,11 @@ getremotesdef(const cfg_obj_t *cctx, const char *list, const char *name,
|
|||
name) == 0)
|
||||
{
|
||||
*ret = obj;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
elt = cfg_list_next(elt);
|
||||
}
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -611,15 +611,15 @@ named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
|
|||
isc_result_t result;
|
||||
|
||||
if (strcmp(list, "parental-agents") == 0) {
|
||||
return (getremotesdef(cctx, list, name, ret));
|
||||
return getremotesdef(cctx, list, name, ret);
|
||||
} else if (strcmp(list, "primaries") == 0) {
|
||||
result = getremotesdef(cctx, list, name, ret);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
result = getremotesdef(cctx, "masters", name, ret);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -634,7 +634,7 @@ named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
|
|||
|
||||
if (!cfg_obj_isstring(obj)) {
|
||||
*namep = NULL;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
*namep = isc_mem_get(mctx, sizeof(**namep));
|
||||
|
|
@ -649,11 +649,11 @@ named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(mctx, *namep, sizeof(**namep));
|
||||
*namep = NULL;
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
dns_name_dup(dns_fixedname_name(&fname), mctx, *namep);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
#define grow_array(mctx, array, newlen, oldlen) \
|
||||
|
|
@ -873,7 +873,7 @@ resume:
|
|||
ipkl->count = addrcount;
|
||||
ipkl->allocated = addrcount;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
if (addrs != NULL) {
|
||||
|
|
@ -909,7 +909,7 @@ cleanup:
|
|||
if (stack != NULL) {
|
||||
isc_mem_put(mctx, stack, stackcount * sizeof(stack[0]));
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -935,10 +935,10 @@ named_config_getport(const cfg_obj_t *config, const char *type,
|
|||
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
|
||||
"port '%u' out of range",
|
||||
cfg_obj_asuint32(portobj));
|
||||
return (ISC_R_RANGE);
|
||||
return ISC_R_RANGE;
|
||||
}
|
||||
*portp = (in_port_t)cfg_obj_asuint32(portobj);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
struct keyalgorithms {
|
||||
|
|
@ -967,7 +967,7 @@ struct keyalgorithms {
|
|||
isc_result_t
|
||||
named_config_getkeyalgorithm(const char *str, const dns_name_t **name,
|
||||
uint16_t *digestbits) {
|
||||
return (named_config_getkeyalgorithm2(str, name, NULL, digestbits));
|
||||
return named_config_getkeyalgorithm2(str, name, NULL, digestbits);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -988,15 +988,15 @@ named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
|
|||
}
|
||||
}
|
||||
if (algorithms[i].str == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
if (str[len] == '-') {
|
||||
result = isc_parse_uint16(&bits, str + len + 1, 10);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
if (bits > algorithms[i].size) {
|
||||
return (ISC_R_RANGE);
|
||||
return ISC_R_RANGE;
|
||||
}
|
||||
} else if (algorithms[i].size == 0) {
|
||||
bits = 128;
|
||||
|
|
@ -1034,5 +1034,5 @@ named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
|
|||
if (digestbits != NULL) {
|
||||
*digestbits = bits;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,23 +45,23 @@ getcommand(isc_lex_t *lex, char **cmdp) {
|
|||
|
||||
result = isc_lex_gettoken(lex, ISC_LEXOPT_EOF, &token);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_lex_ungettoken(lex, &token);
|
||||
|
||||
if (token.type != isc_tokentype_string) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
*cmdp = token.value.as_textregion.base;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static bool
|
||||
command_compare(const char *str, const char *command) {
|
||||
return (strcasecmp(str, command) == 0);
|
||||
return strcasecmp(str, command) == 0;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -87,7 +87,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
|
|||
/*
|
||||
* No data section.
|
||||
*/
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = isccc_cc_lookupstring(data, "type", &cmdline);
|
||||
|
|
@ -95,12 +95,12 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
|
|||
/*
|
||||
* We have no idea what this is.
|
||||
*/
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = isc_lex_create(named_g_mctx, strlen(cmdline), &lex);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_buffer_init(&src, cmdline, strlen(cmdline));
|
||||
|
|
@ -303,5 +303,5 @@ cleanup:
|
|||
isc_lex_destroy(&lex);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,14 +205,14 @@ address_ok(isc_sockaddr_t *sockaddr, controllistener_t *listener) {
|
|||
|
||||
/* ACL doesn't apply to unix domain sockets */
|
||||
if (listener->type != isc_socktype_tcp) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
|
||||
|
||||
result = dns_acl_match(&netaddr, NULL, listener->acl, env, &match,
|
||||
NULL);
|
||||
return (result == ISC_R_SUCCESS && match > 0);
|
||||
return result == ISC_R_SUCCESS && match > 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -634,7 +634,7 @@ control_newconn(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
|
|||
if (result == ISC_R_SHUTTINGDOWN) {
|
||||
shutdown_listener(listener);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
peeraddr = isc_nmhandle_peeraddr(handle);
|
||||
|
|
@ -645,11 +645,11 @@ control_newconn(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
|
|||
NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING,
|
||||
"rejected command channel message from %s",
|
||||
socktext);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
newconnection(listener, handle);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -692,11 +692,11 @@ cfgkeylist_find(const cfg_obj_t *keylist, const char *keyname,
|
|||
}
|
||||
}
|
||||
if (element == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
obj = cfg_listelt_value(element);
|
||||
*objp = obj;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -828,7 +828,7 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
|
|||
NAMED_LOGMODULE_CONTROL, ISC_LOG_INFO,
|
||||
"configuring command channel from '%s'", named_g_keyfile);
|
||||
if (!isc_file_exists(named_g_keyfile)) {
|
||||
return (ISC_R_FILENOTFOUND);
|
||||
return ISC_R_FILENOTFOUND;
|
||||
}
|
||||
|
||||
CHECK(cfg_parser_create(mctx, named_g_lctx, &pctx));
|
||||
|
|
@ -894,7 +894,7 @@ cleanup:
|
|||
if (pctx != NULL) {
|
||||
cfg_parser_destroy(&pctx);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1316,7 +1316,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
|
|||
|
||||
cfg_obj_log(controls, named_g_lctx, ISC_LOG_ERROR,
|
||||
"UNIX domain sockets not yet supported");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
|
||||
#if 0
|
||||
/* XXX: no unix domain socket support in netmgr */
|
||||
|
|
@ -1449,7 +1449,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
|
|||
* down will be taken care of by listen_done().
|
||||
*/
|
||||
ISC_LIST_APPENDLIST(cp->listeners, new_listeners, link);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -1473,10 +1473,10 @@ named_controls_create(named_server_t *server, named_controls_t **ctrlsp) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mutex_destroy(&controls->symtab_lock);
|
||||
isc_mem_put(server->mctx, controls, sizeof(*controls));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
*ctrlsp = controls;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -99,13 +99,13 @@ dlopen_dlz_allnodes(const char *zone, void *driverarg, void *dbdata,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_allnodes == NULL) {
|
||||
return (ISC_R_NOPERM);
|
||||
return ISC_R_NOPERM;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
result = cd->dlz_allnodes(zone, cd->dbdata, allnodes);
|
||||
MAYBE_UNLOCK(cd);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -117,13 +117,13 @@ dlopen_dlz_allowzonexfr(void *driverarg, void *dbdata, const char *name,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_allowzonexfr == NULL) {
|
||||
return (ISC_R_NOPERM);
|
||||
return ISC_R_NOPERM;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
result = cd->dlz_allowzonexfr(cd->dbdata, name, client);
|
||||
MAYBE_UNLOCK(cd);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -135,13 +135,13 @@ dlopen_dlz_authority(const char *zone, void *driverarg, void *dbdata,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_authority == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
result = cd->dlz_authority(zone, cd->dbdata, lookup);
|
||||
MAYBE_UNLOCK(cd);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -156,7 +156,7 @@ dlopen_dlz_findzonedb(void *driverarg, void *dbdata, const char *name,
|
|||
MAYBE_LOCK(cd);
|
||||
result = cd->dlz_findzonedb(cd->dbdata, name, methods, clientinfo);
|
||||
MAYBE_UNLOCK(cd);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -173,7 +173,7 @@ dlopen_dlz_lookup(const char *zone, const char *name, void *driverarg,
|
|||
result = cd->dlz_lookup(zone, name, cd->dbdata, lookup, methods,
|
||||
clientinfo);
|
||||
MAYBE_UNLOCK(cd);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -196,7 +196,7 @@ dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
|
|||
}
|
||||
}
|
||||
|
||||
return (ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -220,7 +220,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||
"dlz_dlopen driver for '%s' needs a path to "
|
||||
"the shared library",
|
||||
dlzname);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
isc_mem_create(&mctx);
|
||||
|
|
@ -321,14 +321,14 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||
|
||||
*dbdata = cd;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
failed:
|
||||
dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
|
||||
|
||||
dlopen_dlz_destroy(NULL, cd);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -365,13 +365,13 @@ dlopen_dlz_newversion(const char *zone, void *driverarg, void *dbdata,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_newversion == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
result = cd->dlz_newversion(zone, cd->dbdata, versionp);
|
||||
MAYBE_UNLOCK(cd);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -406,7 +406,7 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *driverarg,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_configure == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
|
|
@ -415,7 +415,7 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *driverarg,
|
|||
cd->in_configure = false;
|
||||
MAYBE_UNLOCK(cd);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -431,7 +431,7 @@ dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_ssumatch == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
|
|
@ -439,7 +439,7 @@ dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
|
|||
keydata, cd->dbdata);
|
||||
MAYBE_UNLOCK(cd);
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -454,14 +454,14 @@ dlopen_dlz_addrdataset(const char *name, const char *rdatastr, void *driverarg,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_addrdataset == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
result = cd->dlz_addrdataset(name, rdatastr, cd->dbdata, version);
|
||||
MAYBE_UNLOCK(cd);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -476,14 +476,14 @@ dlopen_dlz_subrdataset(const char *name, const char *rdatastr, void *driverarg,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_subrdataset == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
result = cd->dlz_subrdataset(name, rdatastr, cd->dbdata, version);
|
||||
MAYBE_UNLOCK(cd);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -498,14 +498,14 @@ dlopen_dlz_delrdataset(const char *name, const char *type, void *driverarg,
|
|||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_delrdataset == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
result = cd->dlz_delrdataset(name, type, cd->dbdata, version);
|
||||
MAYBE_UNLOCK(cd);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static dns_sdlzmethods_t dlz_dlopen_methods = {
|
||||
|
|
@ -537,7 +537,7 @@ dlz_dlopen_init(isc_mem_t *mctx) {
|
|||
result = ISC_R_UNEXPECTED;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ fuzz_thread_client(void *arg) {
|
|||
named_server_flushonshutdown(named_g_server,
|
||||
false);
|
||||
isc_app_shutdown();
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
raise(SIGSTOP);
|
||||
goto next;
|
||||
|
|
@ -161,7 +161,7 @@ fuzz_thread_client(void *arg) {
|
|||
named_server_flushonshutdown(named_g_server, false);
|
||||
isc_app_shutdown();
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -375,7 +375,7 @@ fuzz_thread_resolver(void *arg) {
|
|||
named_server_flushonshutdown(named_g_server,
|
||||
false);
|
||||
isc_app_shutdown();
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
raise(SIGSTOP);
|
||||
continue;
|
||||
|
|
@ -587,7 +587,7 @@ fuzz_thread_resolver(void *arg) {
|
|||
__AFL_LOOP(0);
|
||||
#endif /* ifdef __AFL_LOOP */
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -718,7 +718,7 @@ fuzz_thread_tcp(void *arg) {
|
|||
named_server_flushonshutdown(named_g_server, false);
|
||||
isc_app_shutdown();
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* ENABLE_AFL */
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ open_geoip2(const char *dir, const char *dbfile, MMDB_s *mmdb) {
|
|||
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
|
||||
"GeoIP2 database '%s/%s': path too long", dir,
|
||||
dbfile);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = MMDB_open(pathbuf, MMDB_MODE_MMAP, mmdb);
|
||||
|
|
@ -52,7 +52,7 @@ open_geoip2(const char *dir, const char *dbfile, MMDB_s *mmdb) {
|
|||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
|
||||
"opened GeoIP2 database '%s'", pathbuf);
|
||||
return (mmdb);
|
||||
return mmdb;
|
||||
}
|
||||
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
|
|
@ -60,7 +60,7 @@ open_geoip2(const char *dir, const char *dbfile, MMDB_s *mmdb) {
|
|||
"unable to open GeoIP2 database '%s' (status %d)",
|
||||
pathbuf, ret);
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
#endif /* HAVE_GEOIP2 */
|
||||
|
||||
|
|
|
|||
|
|
@ -85,14 +85,14 @@ named_log_init(bool safe) {
|
|||
|
||||
named_log_setdefaultsslkeylogfile(lcfg);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
isc_log_destroy(&named_g_lctx);
|
||||
isc_log_setcontext(NULL);
|
||||
dns_log_setcontext(NULL);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -233,7 +233,7 @@ named_log_setdefaultcategory(isc_logconfig_t *lcfg) {
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -242,7 +242,7 @@ named_log_setunmatchedcategory(isc_logconfig_t *lcfg) {
|
|||
|
||||
result = isc_log_usechannel(lcfg, "null", NAMED_LOGCATEGORY_UNMATCHED,
|
||||
NULL);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -59,11 +59,11 @@ category_fromconf(const cfg_obj_t *ccat, isc_logconfig_t *logconfig) {
|
|||
/*
|
||||
* Allow further processing by returning success.
|
||||
*/
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (logconfig == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
module = NULL;
|
||||
|
|
@ -82,10 +82,10 @@ category_fromconf(const cfg_obj_t *ccat, isc_logconfig_t *logconfig) {
|
|||
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
|
||||
"logging channel '%s': %s", channelname,
|
||||
isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -133,7 +133,7 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
|
|||
"channel '%s': exactly one of file, syslog, "
|
||||
"null, and stderr must be present",
|
||||
channelname);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
type = ISC_LOG_TONULL;
|
||||
|
|
@ -312,7 +312,7 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
|
|||
}
|
||||
|
||||
done:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -367,8 +367,8 @@ named_logconfig(isc_logconfig_t *logconfig, const cfg_obj_t *logstmt) {
|
|||
CHECK(named_log_setunmatchedcategory(logconfig));
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ parse_int(char *arg, const char *desc) {
|
|||
if (tmp < 0 || tmp != ltmp) {
|
||||
named_main_earlyfatal("%s '%s' out of range", desc, arg);
|
||||
}
|
||||
return (tmp);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static struct flag_def {
|
||||
|
|
@ -1042,12 +1042,12 @@ create_managers(void) {
|
|||
0 /* quantum */, &named_g_netmgr,
|
||||
&named_g_taskmgr, &named_g_timermgr);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_nm_maxudp(named_g_netmgr, maxudp);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1458,7 +1458,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
|
|||
UNEXPECTED_ERROR("scf_handle_create() failed: %s",
|
||||
scf_strerror(scf_error()));
|
||||
}
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (scf_handle_bind(h) == -1) {
|
||||
|
|
@ -1467,7 +1467,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
|
|||
scf_strerror(scf_error()));
|
||||
}
|
||||
scf_handle_destroy(h);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if ((namelen = scf_myname(h, NULL, 0)) == -1) {
|
||||
|
|
@ -1476,7 +1476,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
|
|||
scf_strerror(scf_error()));
|
||||
}
|
||||
scf_handle_destroy(h);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if ((instance = isc_mem_allocate(mctx, namelen + 1)) == NULL) {
|
||||
|
|
@ -1484,7 +1484,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
|
|||
"allocation failed: %s",
|
||||
isc_result_totext(ISC_R_NOMEMORY));
|
||||
scf_handle_destroy(h);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (scf_myname(h, instance, namelen + 1) == -1) {
|
||||
|
|
@ -1494,12 +1494,12 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
|
|||
}
|
||||
scf_handle_destroy(h);
|
||||
isc_mem_free(mctx, instance);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
scf_handle_destroy(h);
|
||||
*ins_name = instance;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
#endif /* HAVE_LIBSCF */
|
||||
|
||||
|
|
@ -1659,5 +1659,5 @@ main(int argc, char *argv[]) {
|
|||
ProfilerStop();
|
||||
#endif /* ifdef HAVE_GPERFTOOLS_PROFILER */
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,15 +378,15 @@ named_os_closedevnull(void) {
|
|||
static bool
|
||||
all_digits(const char *s) {
|
||||
if (*s == '\0') {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
while (*s != '\0') {
|
||||
if (!isdigit((unsigned char)(*s))) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -478,9 +478,9 @@ named_os_changeuser(void) {
|
|||
uid_t
|
||||
ns_os_uid(void) {
|
||||
if (runas_pw == NULL) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
return (runas_pw->pw_uid);
|
||||
return runas_pw->pw_uid;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -520,22 +520,22 @@ safe_open(const char *filename, mode_t mode, bool append) {
|
|||
|
||||
if (stat(filename, &sb) == -1) {
|
||||
if (errno != ENOENT) {
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
} else if ((sb.st_mode & S_IFREG) == 0) {
|
||||
errno = EOPNOTSUPP;
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (append) {
|
||||
fd = open(filename, O_WRONLY | O_CREAT | O_APPEND, mode);
|
||||
} else {
|
||||
if (unlink(filename) < 0 && errno != ENOENT) {
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, mode);
|
||||
}
|
||||
return (fd);
|
||||
return fd;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -603,7 +603,7 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
|
|||
!strcmp(slash + 1, ".."))
|
||||
{
|
||||
*slash = '/';
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
mode = S_IRUSR | S_IWUSR | S_IXUSR; /* u=rwx */
|
||||
mode |= S_IRGRP | S_IXGRP; /* g=rx */
|
||||
|
|
@ -625,11 +625,11 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
|
|||
}
|
||||
*slash = '/';
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
*slash = '/';
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if !HAVE_SYS_CAPABILITY_H
|
||||
|
|
@ -696,11 +696,11 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
|
|||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("couldn't strdup() '%s': %s", filename,
|
||||
strbuf);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
if (mkdirpath(f, named_main_earlywarning) == -1) {
|
||||
free(f);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
free(f);
|
||||
|
||||
|
|
@ -745,7 +745,7 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
|
|||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("could not open file '%s': %s",
|
||||
filename, strbuf);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fp = fdopen(fd, "w");
|
||||
|
|
@ -755,7 +755,7 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
|
|||
filename, strbuf);
|
||||
}
|
||||
|
||||
return (fp);
|
||||
return fp;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -812,11 +812,11 @@ named_os_issingleton(const char *filename) {
|
|||
struct flock lock;
|
||||
|
||||
if (singletonfd != -1) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (strcasecmp(filename, "none") == 0) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -833,7 +833,7 @@ named_os_issingleton(const char *filename) {
|
|||
named_main_earlywarning("couldn't create '%s'",
|
||||
filename);
|
||||
cleanup_lockfile(false);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -845,7 +845,7 @@ named_os_issingleton(const char *filename) {
|
|||
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
if (singletonfd == -1) {
|
||||
cleanup_lockfile(false);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(&lock, 0, sizeof(lock));
|
||||
|
|
@ -857,10 +857,10 @@ named_os_issingleton(const char *filename) {
|
|||
/* Non-blocking (does not wait for lock) */
|
||||
if (fcntl(singletonfd, F_SETLK, &lock) == -1) {
|
||||
cleanup_lockfile(false);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -929,5 +929,5 @@ named_os_uname(void) {
|
|||
if (unamep == NULL) {
|
||||
getuname();
|
||||
}
|
||||
return (unamep);
|
||||
return unamep;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -125,19 +125,19 @@ user_zonetype(dns_zone_t *zone) {
|
|||
const struct zt *tp;
|
||||
|
||||
if ((dns_zone_getoptions(zone) & DNS_ZONEOPT_AUTOEMPTY) != 0) {
|
||||
return ("builtin");
|
||||
return "builtin";
|
||||
}
|
||||
|
||||
view = dns_zone_getview(zone);
|
||||
if (view != NULL && strcmp(view->name, "_bind") == 0) {
|
||||
return ("builtin");
|
||||
return "builtin";
|
||||
}
|
||||
|
||||
ztype = dns_zone_gettype(zone);
|
||||
for (tp = typemap; tp->string != NULL && tp->type != ztype; tp++) {
|
||||
/* empty */
|
||||
}
|
||||
return (tp->string);
|
||||
return tp->string;
|
||||
}
|
||||
#endif /* ifdef EXTENDED_STATS */
|
||||
|
||||
|
|
@ -1374,7 +1374,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
|||
if (category != NULL) {
|
||||
cat = json_object_new_object();
|
||||
if (cat == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
json_object_object_add(job, category, cat);
|
||||
}
|
||||
|
|
@ -1439,20 +1439,20 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
|||
#ifdef HAVE_JSON_C
|
||||
counter = json_object_new_int64(value);
|
||||
if (counter == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
json_object_object_add(cat, desc[idx], counter);
|
||||
#endif /* ifdef HAVE_JSON_C */
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
#ifdef HAVE_LIBXML2
|
||||
cleanup:
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
|
||||
"failed at dump_counters()");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
#endif /* ifdef HAVE_LIBXML2 */
|
||||
}
|
||||
|
||||
|
|
@ -1522,7 +1522,7 @@ cleanup:
|
|||
|
||||
static bool
|
||||
rdatastatstype_attr(dns_rdatastatstype_t type, unsigned int attr) {
|
||||
return ((DNS_RDATASTATSTYPE_ATTR(type) & attr) != 0);
|
||||
return (DNS_RDATASTATSTYPE_ATTR(type) & attr) != 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1802,7 +1802,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
|
|||
|
||||
statlevel = dns_zone_getstatlevel(zone);
|
||||
if (statlevel == dns_zonestat_none) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
dumparg.type = isc_statsformat_xml;
|
||||
|
|
@ -1960,12 +1960,12 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
|
|||
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* zone */
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
cleanup:
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
|
||||
"Failed at zone_xmlrender()");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2355,7 +2355,7 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
|
|||
|
||||
xmlFreeTextWriter(writer);
|
||||
xmlFreeDoc(doc);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
|
|
@ -2367,7 +2367,7 @@ cleanup:
|
|||
if (doc != NULL) {
|
||||
xmlFreeDoc(doc);
|
||||
}
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -2402,7 +2402,7 @@ render_xml(uint32_t flags, void *arg, unsigned int *retcode,
|
|||
"failed at rendering XML()");
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2412,8 +2412,8 @@ render_xml_all(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_xml(STATS_XML_ALL, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_xml(STATS_XML_ALL, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2423,8 +2423,8 @@ render_xml_status(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_xml(STATS_XML_STATUS, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_xml(STATS_XML_STATUS, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2434,8 +2434,8 @@ render_xml_server(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_xml(STATS_XML_SERVER, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_xml(STATS_XML_SERVER, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2445,8 +2445,8 @@ render_xml_zones(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_xml(STATS_XML_ZONES, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_xml(STATS_XML_ZONES, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2456,8 +2456,8 @@ render_xml_net(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_xml(STATS_XML_NET, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_xml(STATS_XML_NET, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2467,8 +2467,8 @@ render_xml_tasks(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_xml(STATS_XML_TASKS, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_xml(STATS_XML_TASKS, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2478,8 +2478,8 @@ render_xml_mem(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_xml(STATS_XML_MEM, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_xml(STATS_XML_MEM, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2489,8 +2489,8 @@ render_xml_traffic(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_xml(STATS_XML_TRAFFIC, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_xml(STATS_XML_TRAFFIC, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
#endif /* HAVE_LIBXML2 */
|
||||
|
|
@ -2530,7 +2530,7 @@ addzone(char *name, char *classname, const char *ztype, uint32_t serial,
|
|||
json_object *node = json_object_new_object();
|
||||
|
||||
if (node == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
json_object_object_add(node, "name", json_object_new_string(name));
|
||||
|
|
@ -2544,7 +2544,7 @@ addzone(char *name, char *classname, const char *ztype, uint32_t serial,
|
|||
json_object_object_add(node, "type",
|
||||
json_object_new_string(ztype));
|
||||
}
|
||||
return (node);
|
||||
return node;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2563,7 +2563,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
|||
|
||||
statlevel = dns_zone_getstatlevel(zone);
|
||||
if (statlevel == dns_zonestat_none) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
dns_zone_nameonly(zone, buf, sizeof(buf));
|
||||
|
|
@ -2582,7 +2582,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
|||
}
|
||||
|
||||
if (zoneobj == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2750,7 +2750,7 @@ cleanup:
|
|||
if (zoneobj != NULL) {
|
||||
json_object_put(zoneobj);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2788,7 +2788,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
|
|||
|
||||
bindstats = json_object_new_object();
|
||||
if (bindstats == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -3311,7 +3311,7 @@ cleanup:
|
|||
json_object_put(bindstats);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3341,7 +3341,7 @@ render_json(uint32_t flags, void *arg, unsigned int *retcode,
|
|||
"failed at rendering JSON()");
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3351,8 +3351,8 @@ render_json_all(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_json(STATS_JSON_ALL, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_json(STATS_JSON_ALL, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3362,8 +3362,8 @@ render_json_status(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_json(STATS_JSON_STATUS, arg, retcode, retmsg, mimetype,
|
||||
b, freecb, freecb_args));
|
||||
return render_json(STATS_JSON_STATUS, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3373,8 +3373,8 @@ render_json_server(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_json(STATS_JSON_SERVER, arg, retcode, retmsg, mimetype,
|
||||
b, freecb, freecb_args));
|
||||
return render_json(STATS_JSON_SERVER, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3384,8 +3384,8 @@ render_json_zones(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_json(STATS_JSON_ZONES, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_json(STATS_JSON_ZONES, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3395,8 +3395,8 @@ render_json_mem(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_json(STATS_JSON_MEM, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_json(STATS_JSON_MEM, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3406,8 +3406,8 @@ render_json_tasks(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_json(STATS_JSON_TASKS, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_json(STATS_JSON_TASKS, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3417,8 +3417,8 @@ render_json_net(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_json(STATS_JSON_NET, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args));
|
||||
return render_json(STATS_JSON_NET, arg, retcode, retmsg, mimetype, b,
|
||||
freecb, freecb_args);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3428,8 +3428,8 @@ render_json_traffic(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
|
|||
isc_httpdfree_t **freecb, void **freecb_args) {
|
||||
UNUSED(httpd);
|
||||
UNUSED(urlinfo);
|
||||
return (render_json(STATS_JSON_TRAFFIC, arg, retcode, retmsg, mimetype,
|
||||
b, freecb, freecb_args));
|
||||
return render_json(STATS_JSON_TRAFFIC, arg, retcode, retmsg, mimetype,
|
||||
b, freecb, freecb_args);
|
||||
}
|
||||
|
||||
#endif /* HAVE_JSON_C */
|
||||
|
|
@ -3492,7 +3492,7 @@ send:
|
|||
isc_buffer_reinit(b, p, strlen(xslmsg));
|
||||
isc_buffer_add(b, strlen(xslmsg));
|
||||
end:
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3527,7 +3527,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
|
|||
match > 0)
|
||||
{
|
||||
UNLOCK(&listener->lock);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
UNLOCK(&listener->lock);
|
||||
|
||||
|
|
@ -3536,7 +3536,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
|
|||
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
|
||||
"rejected statistics connection from %s", socktext);
|
||||
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3570,7 +3570,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
|
|||
UNUSED(aclconfctx);
|
||||
UNUSED(socktext);
|
||||
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
#else
|
||||
isc_result_t result;
|
||||
named_statschannel_t *listener = NULL;
|
||||
|
|
@ -3674,7 +3674,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
|
|||
NAMED_LOGMODULE_SERVER, ISC_LOG_NOTICE,
|
||||
"statistics channel listening on %s", socktext);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
if (listener->acl != NULL) {
|
||||
|
|
@ -3683,7 +3683,7 @@ cleanup:
|
|||
isc_mutex_destroy(&listener->lock);
|
||||
isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -3879,7 +3879,7 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
|
|||
}
|
||||
|
||||
ISC_LIST_APPENDLIST(server->statschannels, new_listeners, link);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -4107,5 +4107,5 @@ named_stats_dump(named_server_t *server, FILE *fp) {
|
|||
|
||||
fprintf(fp, "--- Statistics Dump --- (%lu)\n", (unsigned long)now);
|
||||
|
||||
return (ISC_R_SUCCESS); /* this function currently always succeeds */
|
||||
return ISC_R_SUCCESS; /* this function currently always succeeds */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
|||
|
||||
result = dns_tkeyctx_create(mctx, &tctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
|
|
@ -107,9 +107,9 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
|||
}
|
||||
|
||||
*tctxp = tctx;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
failure:
|
||||
dns_tkeyctx_destroy(&tctx);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,13 +129,13 @@ add_doh_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
|
|||
dns_transport_set_remote_hostname);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
failure:
|
||||
cfg_obj_log(doh, named_g_lctx, ISC_LOG_ERROR,
|
||||
"configuring DoH '%s': %s", dohid,
|
||||
isc_result_totext(result));
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -181,13 +181,13 @@ add_tls_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
|
|||
dns_transport_set_remote_hostname);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
failure:
|
||||
cfg_obj_log(tls, named_g_lctx, ISC_LOG_ERROR,
|
||||
"configuring tls '%s': %s", tlsid,
|
||||
isc_result_totext(result));
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define CHECK(f) \
|
||||
|
|
@ -214,7 +214,7 @@ transport_list_fromconfig(const cfg_obj_t *config, dns_transport_list_t *list) {
|
|||
obj = NULL;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -256,8 +256,8 @@ named_transports_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
|||
}
|
||||
|
||||
*listp = list;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
failure:
|
||||
dns_transport_list_detach(&list);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
|
|||
dns_tsigkey_detach(&tsigkey);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
failure:
|
||||
cfg_obj_log(key, named_g_lctx, ISC_LOG_ERROR,
|
||||
|
|
@ -129,7 +129,7 @@ failure:
|
|||
if (secret != NULL) {
|
||||
isc_mem_put(mctx, secret, secretalloc);
|
||||
}
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -154,7 +154,7 @@ named_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
|||
|
||||
result = dns_tsigkeyring_create(mctx, &ring);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
for (i = 0;; i++) {
|
||||
|
|
@ -173,9 +173,9 @@ named_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
|||
}
|
||||
|
||||
*ringp = ring;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
failure:
|
||||
dns_tsigkeyring_detach(&ring);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
|
|||
/* Failing that, see if there's a default ACL already in the view */
|
||||
if (aclp != NULL && *aclp != NULL) {
|
||||
(*setzacl)(zone, *aclp);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/* Check for default ACLs that haven't been parsed yet */
|
||||
|
|
@ -172,14 +172,14 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
|
|||
(void)named_config_get(maps, aclname, &aclobj);
|
||||
if (aclobj == NULL) {
|
||||
(*clearzacl)(zone);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
parse_acl:
|
||||
result = cfg_acl_fromconfig(aclobj, config, named_g_lctx, actx,
|
||||
named_g_mctx, 0, &acl);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
(*setzacl)(zone, acl);
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ parse_acl:
|
|||
}
|
||||
|
||||
dns_acl_detach(&acl);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -209,7 +209,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
|
||||
if (updatepolicy == NULL) {
|
||||
dns_zone_setssutable(zone, NULL);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (cfg_obj_isstring(updatepolicy) &&
|
||||
|
|
@ -377,7 +377,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
|
||||
cleanup:
|
||||
dns_ssutable_detach(&table);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -419,7 +419,7 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
cfg_obj_log(zconfig, named_g_lctx, ISC_LOG_ERROR,
|
||||
"port is not configurable for "
|
||||
"static stub server-addresses");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
isc_netaddr_fromsockaddr(&na, sa);
|
||||
if (isc_netaddr_getzone(&na) != 0) {
|
||||
|
|
@ -427,7 +427,7 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
"scoped address is not allowed "
|
||||
"for static stub "
|
||||
"server-addresses");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
switch (na.family) {
|
||||
|
|
@ -458,7 +458,7 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
if (ISC_LIST_EMPTY(rdatalist_a->rdata) &&
|
||||
ISC_LIST_EMPTY(rdatalist_aaaa->rdata))
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/* Add to the list an apex NS with the ns name being the origin name */
|
||||
|
|
@ -472,7 +472,7 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
®ion);
|
||||
ISC_LIST_APPEND(rdatalist_ns->rdata, rdata, link);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -513,14 +513,14 @@ configure_staticstub_servernames(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
"server-name '%s' is not a valid "
|
||||
"name",
|
||||
str);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
if (dns_name_issubdomain(nsname, dns_zone_getorigin(zone))) {
|
||||
cfg_obj_log(zconfig, named_g_lctx, ISC_LOG_ERROR,
|
||||
"server-name '%s' must not be a "
|
||||
"subdomain of zone name '%s'",
|
||||
str, zname);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
dns_name_toregion(nsname, &sregion);
|
||||
|
|
@ -534,7 +534,7 @@ configure_staticstub_servernames(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
ISC_LIST_APPEND(rdatalist->rdata, rdata, link);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -679,7 +679,7 @@ cleanup:
|
|||
|
||||
INSIST(dbversion == NULL);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -692,7 +692,7 @@ zonetype_fromconfig(const cfg_obj_t *map) {
|
|||
|
||||
result = cfg_map_get(map, "type", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
return (named_config_getzonetype(obj));
|
||||
return named_config_getzonetype(obj);
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -723,11 +723,11 @@ strtoargvsub(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp,
|
|||
|
||||
result = strtoargvsub(mctx, p, argcp, argvp, n + 1);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
(*argvp)[n] = s;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -739,7 +739,7 @@ strtoargvsub(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp,
|
|||
*/
|
||||
static isc_result_t
|
||||
strtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp) {
|
||||
return (strtoargvsub(mctx, s, argcp, argvp, 0));
|
||||
return strtoargvsub(mctx, s, argcp, argvp, 0);
|
||||
}
|
||||
|
||||
static const char *const primary_synonyms[] = { "primary", "master", NULL };
|
||||
|
|
@ -787,12 +787,12 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey, const isc_sockaddr_t *srcaddr,
|
|||
|
||||
/* interfacemgr can be destroyed only in exclusive mode. */
|
||||
if (named_g_server->interfacemgr == NULL) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!ns_interfacemgr_listeningon(named_g_server->interfacemgr, dstaddr))
|
||||
{
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
isc_netaddr_fromsockaddr(&netsrc, srcaddr);
|
||||
|
|
@ -835,7 +835,7 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey, const isc_sockaddr_t *srcaddr,
|
|||
break;
|
||||
}
|
||||
}
|
||||
return (view == myview);
|
||||
return view == myview;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -853,7 +853,7 @@ process_notifytype(dns_notifytype_t ntype, dns_zonetype_t ztype,
|
|||
* zone is configured with something else than "notify yes;".
|
||||
*/
|
||||
if (ztype != dns_zone_mirror || ntype != dns_notifytype_yes) {
|
||||
return (ntype);
|
||||
return ntype;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -867,7 +867,7 @@ process_notifytype(dns_notifytype_t ntype, dns_zonetype_t ztype,
|
|||
zname);
|
||||
}
|
||||
|
||||
return (dns_notifytype_explicit);
|
||||
return dns_notifytype_explicit;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -2019,7 +2019,7 @@ cleanup:
|
|||
if (kasp != NULL) {
|
||||
dns_kasp_detach(&kasp);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2037,11 +2037,11 @@ named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
|
|||
dns_zone_settype(zone, dns_zone_dlz);
|
||||
result = dns_sdlz_setdb(dlzdatabase, rdclass, name, &db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
result = dns_zone_dlzpostload(zone, db);
|
||||
dns_db_detach(&db);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -2063,7 +2063,7 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
|
|||
if (zonetype_fromconfig(zoptions) == dns_zone_staticstub) {
|
||||
dns_zone_log(zone, ISC_LOG_DEBUG(1),
|
||||
"not reusable: staticstub");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If there's a raw zone, use that for filename and type comparison */
|
||||
|
|
@ -2083,17 +2083,17 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
|
|||
if (!inline_signing && has_raw) {
|
||||
dns_zone_log(zone, ISC_LOG_DEBUG(1),
|
||||
"not reusable: old zone was inline-signing");
|
||||
return (false);
|
||||
return false;
|
||||
} else if (inline_signing && !has_raw) {
|
||||
dns_zone_log(zone, ISC_LOG_DEBUG(1),
|
||||
"not reusable: old zone was not inline-signing");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (zonetype_fromconfig(zoptions) != ztype) {
|
||||
dns_zone_log(zone, ISC_LOG_DEBUG(1),
|
||||
"not reusable: type mismatch");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
|
|
@ -2109,10 +2109,10 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
|
|||
{
|
||||
dns_zone_log(zone, ISC_LOG_DEBUG(1),
|
||||
"not reusable: filename mismatch");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -2126,5 +2126,5 @@ named_zone_inlinesigning(const cfg_obj_t *zconfig) {
|
|||
ISC_R_SUCCESS &&
|
||||
cfg_obj_asboolean(signing));
|
||||
|
||||
return (inline_signing);
|
||||
return inline_signing;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ getzoneclass(void) {
|
|||
if (zoneclass == dns_rdataclass_none) {
|
||||
zoneclass = defaultclass;
|
||||
}
|
||||
return (zoneclass);
|
||||
return zoneclass;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -253,9 +253,9 @@ setzoneclass(dns_rdataclass_t rdclass) {
|
|||
zoneclass = rdclass;
|
||||
}
|
||||
if (zoneclass != rdclass) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -319,7 +319,7 @@ nsu_strsep(char **stringp, const char *delim) {
|
|||
char sc, dc;
|
||||
|
||||
if (string == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (; *string != '\0'; string++) {
|
||||
|
|
@ -340,11 +340,11 @@ nsu_strsep(char **stringp, const char *delim) {
|
|||
if (sc == dc) {
|
||||
*s++ = '\0';
|
||||
*stringp = s;
|
||||
return (string);
|
||||
return string;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (string);
|
||||
return string;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -380,7 +380,7 @@ parse_hmac(const dns_name_t **hmacp, const char *hmacstr, size_t len,
|
|||
|
||||
if (len >= sizeof(buf)) {
|
||||
error("unknown key type '%.*s'", (int)(len), hmacstr);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Copy len bytes and NUL terminate. */
|
||||
|
|
@ -393,7 +393,7 @@ parse_hmac(const dns_name_t **hmacp, const char *hmacstr, size_t len,
|
|||
result = isc_parse_uint16(&digestbits, &buf[9], 10);
|
||||
if (result != ISC_R_SUCCESS || digestbits > 128) {
|
||||
error("digest-bits out of range [0..128]");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
*digestbitsp = (digestbits + 7) & ~0x7U;
|
||||
} else if (strcasecmp(buf, "hmac-sha1") == 0) {
|
||||
|
|
@ -403,7 +403,7 @@ parse_hmac(const dns_name_t **hmacp, const char *hmacstr, size_t len,
|
|||
result = isc_parse_uint16(&digestbits, &buf[10], 10);
|
||||
if (result != ISC_R_SUCCESS || digestbits > 160) {
|
||||
error("digest-bits out of range [0..160]");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
*digestbitsp = (digestbits + 7) & ~0x7U;
|
||||
} else if (strcasecmp(buf, "hmac-sha224") == 0) {
|
||||
|
|
@ -413,7 +413,7 @@ parse_hmac(const dns_name_t **hmacp, const char *hmacstr, size_t len,
|
|||
result = isc_parse_uint16(&digestbits, &buf[12], 10);
|
||||
if (result != ISC_R_SUCCESS || digestbits > 224) {
|
||||
error("digest-bits out of range [0..224]");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
*digestbitsp = (digestbits + 7) & ~0x7U;
|
||||
} else if (strcasecmp(buf, "hmac-sha256") == 0) {
|
||||
|
|
@ -423,7 +423,7 @@ parse_hmac(const dns_name_t **hmacp, const char *hmacstr, size_t len,
|
|||
result = isc_parse_uint16(&digestbits, &buf[12], 10);
|
||||
if (result != ISC_R_SUCCESS || digestbits > 256) {
|
||||
error("digest-bits out of range [0..256]");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
*digestbitsp = (digestbits + 7) & ~0x7U;
|
||||
} else if (strcasecmp(buf, "hmac-sha384") == 0) {
|
||||
|
|
@ -433,7 +433,7 @@ parse_hmac(const dns_name_t **hmacp, const char *hmacstr, size_t len,
|
|||
result = isc_parse_uint16(&digestbits, &buf[12], 10);
|
||||
if (result != ISC_R_SUCCESS || digestbits > 384) {
|
||||
error("digest-bits out of range [0..384]");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
*digestbitsp = (digestbits + 7) & ~0x7U;
|
||||
} else if (strcasecmp(buf, "hmac-sha512") == 0) {
|
||||
|
|
@ -443,14 +443,14 @@ parse_hmac(const dns_name_t **hmacp, const char *hmacstr, size_t len,
|
|||
result = isc_parse_uint16(&digestbits, &buf[12], 10);
|
||||
if (result != ISC_R_SUCCESS || digestbits > 512) {
|
||||
error("digest-bits out of range [0..512]");
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
*digestbitsp = (digestbits + 7) & ~0x7U;
|
||||
} else {
|
||||
error("unknown key type '%s'", buf);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -464,7 +464,7 @@ basenamelen(const char *file) {
|
|||
} else if (len > 4 && strcmp(file + len - 4, ".key") == 0) {
|
||||
len -= 4;
|
||||
}
|
||||
return (len);
|
||||
return len;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -560,7 +560,7 @@ read_sessionkey(isc_mem_t *mctx, isc_log_t *lctx) {
|
|||
int len;
|
||||
|
||||
if (!isc_file_exists(keyfile)) {
|
||||
return (ISC_R_FILENOTFOUND);
|
||||
return ISC_R_FILENOTFOUND;
|
||||
}
|
||||
|
||||
result = cfg_parser_create(mctx, lctx, &pctx);
|
||||
|
|
@ -606,7 +606,7 @@ cleanup:
|
|||
isc_mem_free(mctx, keystr);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -974,7 +974,7 @@ get_addresses(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
|
|||
error("couldn't get address for '%s': %s", host,
|
||||
isc_result_totext(result));
|
||||
}
|
||||
return (count);
|
||||
return count;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1246,7 +1246,7 @@ parse_name(char **cmdlinep, dns_message_t *msg, dns_name_t **namep) {
|
|||
word = nsu_strsep(cmdlinep, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read owner name\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
result = dns_message_gettempname(msg, namep);
|
||||
|
|
@ -1258,10 +1258,10 @@ parse_name(char **cmdlinep, dns_message_t *msg, dns_name_t **namep) {
|
|||
error("invalid owner name: %s", isc_result_totext(result));
|
||||
isc_buffer_invalidate(&source);
|
||||
dns_message_puttempname(msg, namep);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
isc_buffer_invalidate(&source);
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1276,7 +1276,7 @@ parse_rdata(char **cmdlinep, dns_rdataclass_t rdataclass,
|
|||
|
||||
if (cmdline == NULL) {
|
||||
rdata->flags = DNS_RDATA_UPDATE;
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
while (*cmdline != 0 && isspace((unsigned char)*cmdline)) {
|
||||
|
|
@ -1308,13 +1308,13 @@ parse_rdata(char **cmdlinep, dns_rdataclass_t rdataclass,
|
|||
fprintf(stderr, "invalid rdata format: %s\n",
|
||||
isc_result_totext(result));
|
||||
isc_buffer_free(&buf);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
} else {
|
||||
rdata->flags = DNS_RDATA_UPDATE;
|
||||
}
|
||||
*cmdlinep = cmdline;
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1337,7 +1337,7 @@ make_prereq(char *cmdline, bool ispositive, bool isrrset) {
|
|||
*/
|
||||
retval = parse_name(&cmdline, updatemsg, &name);
|
||||
if (retval != STATUS_MORE) {
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1420,13 +1420,13 @@ make_prereq(char *cmdline, bool ispositive, bool isrrset) {
|
|||
ISC_LIST_INIT(name->list);
|
||||
ISC_LIST_APPEND(name->list, rdataset, link);
|
||||
dns_message_addname(updatemsg, name, DNS_SECTION_PREREQUISITE);
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
|
||||
failure:
|
||||
if (name != NULL) {
|
||||
dns_message_puttempname(updatemsg, &name);
|
||||
}
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1438,7 +1438,7 @@ evaluate_prereq(char *cmdline) {
|
|||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read operation code\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
if (strcasecmp(word, "nxdomain") == 0) {
|
||||
ispositive = false;
|
||||
|
|
@ -1454,9 +1454,9 @@ evaluate_prereq(char *cmdline) {
|
|||
isrrset = true;
|
||||
} else {
|
||||
fprintf(stderr, "incorrect operation code: %s\n", word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
return (make_prereq(cmdline, ispositive, isrrset));
|
||||
return make_prereq(cmdline, ispositive, isrrset);
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1466,13 +1466,13 @@ evaluate_server(char *cmdline) {
|
|||
|
||||
if (local_only) {
|
||||
fprintf(stderr, "cannot reset server in localhost-only mode\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read server name\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
server = word;
|
||||
|
||||
|
|
@ -1484,13 +1484,13 @@ evaluate_server(char *cmdline) {
|
|||
port = strtol(word, &endp, 10);
|
||||
if (*endp != 0) {
|
||||
fprintf(stderr, "port '%s' is not numeric\n", word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
} else if (port < 1 || port > 65535) {
|
||||
fprintf(stderr,
|
||||
"port '%s' is out of range "
|
||||
"(1 to 65535)\n",
|
||||
word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1510,10 +1510,10 @@ evaluate_server(char *cmdline) {
|
|||
memset(servers, 0, ns_alloc * sizeof(isc_sockaddr_t));
|
||||
ns_total = get_addresses(server, (in_port_t)port, servers, ns_alloc);
|
||||
if (ns_total == 0) {
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1526,7 +1526,7 @@ evaluate_local(char *cmdline) {
|
|||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read server name\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
local = word;
|
||||
|
||||
|
|
@ -1538,13 +1538,13 @@ evaluate_local(char *cmdline) {
|
|||
port = strtol(word, &endp, 10);
|
||||
if (*endp != 0) {
|
||||
fprintf(stderr, "port '%s' is not numeric\n", word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
} else if (port < 1 || port > 65535) {
|
||||
fprintf(stderr,
|
||||
"port '%s' is out of range "
|
||||
"(1 to 65535)\n",
|
||||
word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1560,10 +1560,10 @@ evaluate_local(char *cmdline) {
|
|||
isc_sockaddr_fromin(localaddr4, &in4, (in_port_t)port);
|
||||
} else {
|
||||
fprintf(stderr, "invalid address %s", local);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1584,7 +1584,7 @@ evaluate_key(char *cmdline) {
|
|||
namestr = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (namestr == NULL || *namestr == 0) {
|
||||
fprintf(stderr, "could not read key name\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
mykeyname = dns_fixedname_initname(&fkeyname);
|
||||
|
|
@ -1592,7 +1592,7 @@ evaluate_key(char *cmdline) {
|
|||
n = strchr(namestr, ':');
|
||||
if (n != NULL) {
|
||||
if (!parse_hmac(&hmacname, namestr, n - namestr, &digestbits)) {
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
namestr = n + 1;
|
||||
} else {
|
||||
|
|
@ -1604,13 +1604,13 @@ evaluate_key(char *cmdline) {
|
|||
result = dns_name_fromtext(mykeyname, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "could not parse key name\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
secretstr = nsu_strsep(&cmdline, "\r\n");
|
||||
if (secretstr == NULL || *secretstr == 0) {
|
||||
fprintf(stderr, "could not read key secret\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
secretlen = strlen(secretstr) * 3 / 4;
|
||||
secret = isc_mem_allocate(gmctx, secretlen);
|
||||
|
|
@ -1621,7 +1621,7 @@ evaluate_key(char *cmdline) {
|
|||
fprintf(stderr, "could not create key from %s: %s\n", secretstr,
|
||||
isc_result_totext(result));
|
||||
isc_mem_free(gmctx, secret);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
secretlen = isc_buffer_usedlength(&secretbuf);
|
||||
|
||||
|
|
@ -1634,10 +1634,10 @@ evaluate_key(char *cmdline) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "could not create key from %s %s: %s\n",
|
||||
namestr, secretstr, isc_result_totext(result));
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
dst_key_setbits(tsigkey->key, digestbits);
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1649,7 +1649,7 @@ evaluate_zone(char *cmdline) {
|
|||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read zone name\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
userzone = dns_fixedname_initname(&fuserzone);
|
||||
|
|
@ -1659,10 +1659,10 @@ evaluate_zone(char *cmdline) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
userzone = NULL; /* Lest it point to an invalid name */
|
||||
fprintf(stderr, "could not parse zone name\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1679,19 +1679,19 @@ evaluate_realm(char *cmdline) {
|
|||
|
||||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
n = snprintf(buf, sizeof(buf), "@%s", word);
|
||||
if (n < 0 || (size_t)n >= sizeof(buf)) {
|
||||
error("realm is too long");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
realm = isc_mem_strdup(gmctx, buf);
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
#else /* HAVE_GSSAPI */
|
||||
UNUSED(cmdline);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
#endif /* HAVE_GSSAPI */
|
||||
}
|
||||
|
||||
|
|
@ -1704,29 +1704,29 @@ evaluate_ttl(char *cmdline) {
|
|||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read ttl\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
if (!strcasecmp(word, "none")) {
|
||||
default_ttl = 0;
|
||||
default_ttl_set = false;
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
result = isc_parse_uint32(&ttl, word, 10);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
if (ttl > TTL_MAX) {
|
||||
fprintf(stderr, "ttl '%s' is out of range (0 to %u)\n", word,
|
||||
TTL_MAX);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
default_ttl = ttl;
|
||||
default_ttl_set = true;
|
||||
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1739,7 +1739,7 @@ evaluate_class(char *cmdline) {
|
|||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read class name\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
r.base = word;
|
||||
|
|
@ -1747,19 +1747,19 @@ evaluate_class(char *cmdline) {
|
|||
result = dns_rdataclass_fromtext(&rdclass, &r);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "could not parse class name: %s\n", word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
switch (rdclass) {
|
||||
case dns_rdataclass_none:
|
||||
case dns_rdataclass_any:
|
||||
case dns_rdataclass_reserved0:
|
||||
fprintf(stderr, "bad default class: %s\n", word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
default:
|
||||
defaultclass = rdclass;
|
||||
}
|
||||
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1783,7 +1783,7 @@ update_addordelete(char *cmdline, bool isdelete) {
|
|||
*/
|
||||
retval = parse_name(&cmdline, updatemsg, &name);
|
||||
if (retval != STATUS_MORE) {
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
result = dns_message_gettemprdata(updatemsg, &rdata);
|
||||
|
|
@ -1963,14 +1963,14 @@ doneparsing:
|
|||
ISC_LIST_INIT(name->list);
|
||||
ISC_LIST_APPEND(name->list, rdataset, link);
|
||||
dns_message_addname(updatemsg, name, DNS_SECTION_UPDATE);
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
|
||||
failure:
|
||||
if (name != NULL) {
|
||||
dns_message_puttempname(updatemsg, &name);
|
||||
}
|
||||
dns_message_puttemprdata(updatemsg, &rdata);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -1982,7 +1982,7 @@ evaluate_update(char *cmdline) {
|
|||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read operation code\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
if (strcasecmp(word, "delete") == 0) {
|
||||
isdelete = true;
|
||||
|
|
@ -1992,9 +1992,9 @@ evaluate_update(char *cmdline) {
|
|||
isdelete = false;
|
||||
} else {
|
||||
fprintf(stderr, "incorrect operation code: %s\n", word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
return (update_addordelete(cmdline, isdelete));
|
||||
return update_addordelete(cmdline, isdelete);
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -2005,7 +2005,7 @@ evaluate_checknames(char *cmdline) {
|
|||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
if (word == NULL || *word == 0) {
|
||||
fprintf(stderr, "could not read check-names directive\n");
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
if (strcasecmp(word, "yes") == 0 || strcasecmp(word, "true") == 0 ||
|
||||
strcasecmp(word, "on") == 0)
|
||||
|
|
@ -2018,9 +2018,9 @@ evaluate_checknames(char *cmdline) {
|
|||
checknames = false;
|
||||
} else {
|
||||
fprintf(stderr, "incorrect check-names directive: %s\n", word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -2100,55 +2100,55 @@ do_next_command(char *cmdline) {
|
|||
word = nsu_strsep(&cmdline, " \t\r\n");
|
||||
|
||||
if (word == NULL || *word == 0) {
|
||||
return (STATUS_SEND);
|
||||
return STATUS_SEND;
|
||||
}
|
||||
if (word[0] == ';') {
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
if (strcasecmp(word, "quit") == 0) {
|
||||
return (STATUS_QUIT);
|
||||
return STATUS_QUIT;
|
||||
}
|
||||
if (strcasecmp(word, "prereq") == 0) {
|
||||
return (evaluate_prereq(cmdline));
|
||||
return evaluate_prereq(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "nxdomain") == 0) {
|
||||
return (make_prereq(cmdline, false, false));
|
||||
return make_prereq(cmdline, false, false);
|
||||
}
|
||||
if (strcasecmp(word, "yxdomain") == 0) {
|
||||
return (make_prereq(cmdline, true, false));
|
||||
return make_prereq(cmdline, true, false);
|
||||
}
|
||||
if (strcasecmp(word, "nxrrset") == 0) {
|
||||
return (make_prereq(cmdline, false, true));
|
||||
return make_prereq(cmdline, false, true);
|
||||
}
|
||||
if (strcasecmp(word, "yxrrset") == 0) {
|
||||
return (make_prereq(cmdline, true, true));
|
||||
return make_prereq(cmdline, true, true);
|
||||
}
|
||||
if (strcasecmp(word, "update") == 0) {
|
||||
return (evaluate_update(cmdline));
|
||||
return evaluate_update(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "delete") == 0) {
|
||||
return (update_addordelete(cmdline, true));
|
||||
return update_addordelete(cmdline, true);
|
||||
}
|
||||
if (strcasecmp(word, "del") == 0) {
|
||||
return (update_addordelete(cmdline, true));
|
||||
return update_addordelete(cmdline, true);
|
||||
}
|
||||
if (strcasecmp(word, "add") == 0) {
|
||||
return (update_addordelete(cmdline, false));
|
||||
return update_addordelete(cmdline, false);
|
||||
}
|
||||
if (strcasecmp(word, "server") == 0) {
|
||||
return (evaluate_server(cmdline));
|
||||
return evaluate_server(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "local") == 0) {
|
||||
return (evaluate_local(cmdline));
|
||||
return evaluate_local(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "zone") == 0) {
|
||||
return (evaluate_zone(cmdline));
|
||||
return evaluate_zone(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "class") == 0) {
|
||||
return (evaluate_class(cmdline));
|
||||
return evaluate_class(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "send") == 0) {
|
||||
return (STATUS_SEND);
|
||||
return STATUS_SEND;
|
||||
}
|
||||
if (strcasecmp(word, "debug") == 0) {
|
||||
if (debugging) {
|
||||
|
|
@ -2156,14 +2156,14 @@ do_next_command(char *cmdline) {
|
|||
} else {
|
||||
debugging = true;
|
||||
}
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
if (strcasecmp(word, "ttl") == 0) {
|
||||
return (evaluate_ttl(cmdline));
|
||||
return evaluate_ttl(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "show") == 0) {
|
||||
show_message(stdout, updatemsg, "Outgoing update query:");
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
if (strcasecmp(word, "answer") == 0) {
|
||||
LOCK(&answer_lock);
|
||||
|
|
@ -2171,19 +2171,19 @@ do_next_command(char *cmdline) {
|
|||
show_message(stdout, answer, "Answer:");
|
||||
}
|
||||
UNLOCK(&answer_lock);
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
if (strcasecmp(word, "key") == 0) {
|
||||
usegsstsig = false;
|
||||
return (evaluate_key(cmdline));
|
||||
return evaluate_key(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "realm") == 0) {
|
||||
return (evaluate_realm(cmdline));
|
||||
return evaluate_realm(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "check-names") == 0 ||
|
||||
strcasecmp(word, "checknames") == 0)
|
||||
{
|
||||
return (evaluate_checknames(cmdline));
|
||||
return evaluate_checknames(cmdline);
|
||||
}
|
||||
if (strcasecmp(word, "gsstsig") == 0) {
|
||||
#if HAVE_GSSAPI
|
||||
|
|
@ -2192,7 +2192,7 @@ do_next_command(char *cmdline) {
|
|||
#else /* HAVE_GSSAPI */
|
||||
fprintf(stderr, "gsstsig not supported\n");
|
||||
#endif /* HAVE_GSSAPI */
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
if (strcasecmp(word, "oldgsstsig") == 0) {
|
||||
#if HAVE_GSSAPI
|
||||
|
|
@ -2201,7 +2201,7 @@ do_next_command(char *cmdline) {
|
|||
#else /* HAVE_GSSAPI */
|
||||
fprintf(stderr, "gsstsig not supported\n");
|
||||
#endif /* HAVE_GSSAPI */
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
if (strcasecmp(word, "help") == 0) {
|
||||
fprintf(stdout, "nsupdate " PACKAGE_VERSION ":\n"
|
||||
|
|
@ -2243,14 +2243,14 @@ do_next_command(char *cmdline) {
|
|||
"record to the zone)\n"
|
||||
"[update] del[ete] .... (remove the given "
|
||||
"record(s) from the zone)\n");
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
if (strcasecmp(word, "version") == 0) {
|
||||
fprintf(stdout, "nsupdate " PACKAGE_VERSION "\n");
|
||||
return (STATUS_MORE);
|
||||
return STATUS_MORE;
|
||||
}
|
||||
fprintf(stderr, "incorrect section name: %s\n", word);
|
||||
return (STATUS_SYNTAX);
|
||||
return STATUS_SYNTAX;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
|
@ -2284,7 +2284,7 @@ get_next_command(void) {
|
|||
free(ptr);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -2299,9 +2299,9 @@ user_interaction(void) {
|
|||
}
|
||||
}
|
||||
if (result == STATUS_SEND) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -2346,10 +2346,10 @@ next_primary(const char *caller, isc_sockaddr_t *addr, isc_result_t eresult) {
|
|||
fprintf(stderr, "; Communication with %s failed: %s\n", addrbuf,
|
||||
isc_result_totext(eresult));
|
||||
if (++primary_inuse >= primary_total) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
ddebug("%s: trying next server", caller);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -3456,8 +3456,8 @@ main(int argc, char **argv) {
|
|||
isc_app_finish();
|
||||
|
||||
if (seenerror) {
|
||||
return (2);
|
||||
return 2;
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ static const char *filter_a_enums[] = { "break-dnssec", NULL };
|
|||
|
||||
static isc_result_t
|
||||
parse_filter_a(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
|
||||
return (cfg_parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));
|
||||
return cfg_parse_enum_or_other(pctx, type, &cfg_type_boolean, ret);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -212,7 +212,7 @@ parse_filter_a_on(const cfg_obj_t *param_obj, const char *param_name,
|
|||
|
||||
result = cfg_map_get(param_obj, param_name, &obj);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (cfg_obj_isboolean(obj)) {
|
||||
|
|
@ -227,7 +227,7 @@ parse_filter_a_on(const cfg_obj_t *param_obj, const char *param_name,
|
|||
result = ISC_R_UNEXPECTED;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -240,7 +240,7 @@ check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, isc_log_t *lctx,
|
|||
|
||||
cfg_map_get(fmap, "filter-a", &aclobj);
|
||||
if (aclobj == NULL) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
CHECK(cfg_acl_fromconfig(aclobj, (const cfg_obj_t *)cfg, lctx,
|
||||
|
|
@ -268,7 +268,7 @@ cleanup:
|
|||
dns_acl_detach(&acl);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -309,7 +309,7 @@ cleanup:
|
|||
if (parser != NULL) {
|
||||
cfg_parser_destroy(&parser);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -362,7 +362,7 @@ cleanup:
|
|||
plugin_destroy((void **)&inst);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -390,7 +390,7 @@ cleanup:
|
|||
if (parser != NULL) {
|
||||
cfg_parser_destroy(&parser);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -420,7 +420,7 @@ plugin_destroy(void **instp) {
|
|||
*/
|
||||
int
|
||||
plugin_version(void) {
|
||||
return (NS_PLUGIN_VERSION);
|
||||
return NS_PLUGIN_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -445,14 +445,14 @@ typedef struct section_filter {
|
|||
static bool
|
||||
is_v4_client(ns_client_t *client) {
|
||||
if (isc_sockaddr_pf(&client->peeraddr) == AF_INET) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (isc_sockaddr_pf(&client->peeraddr) == AF_INET6 &&
|
||||
IN6_IS_ADDR_V4MAPPED(&client->peeraddr.type.sin6.sin6_addr))
|
||||
{
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -463,9 +463,9 @@ is_v6_client(ns_client_t *client) {
|
|||
if (isc_sockaddr_pf(&client->peeraddr) == AF_INET6 &&
|
||||
!IN6_IS_ADDR_V4MAPPED(&client->peeraddr.type.sin6.sin6_addr))
|
||||
{
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
static filter_data_t *
|
||||
|
|
@ -478,7 +478,7 @@ client_state_get(const query_ctx_t *qctx, filter_instance_t *inst) {
|
|||
sizeof(qctx->client), (void **)&client_state);
|
||||
UNLOCK(&inst->hlock);
|
||||
|
||||
return (result == ISC_R_SUCCESS ? client_state : NULL);
|
||||
return result == ISC_R_SUCCESS ? client_state : NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -574,7 +574,7 @@ process_name(query_ctx_t *qctx, filter_a_t mode, const dns_name_t *name,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (modified);
|
||||
return modified;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -645,7 +645,7 @@ filter_qctx_initialize(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
client_state_create(qctx, inst);
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -663,7 +663,7 @@ filter_prep_response_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
*resp = ISC_R_UNSET;
|
||||
|
||||
if (client_state == NULL) {
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
if (inst->v4_a != NONE || inst->v6_a != NONE) {
|
||||
|
|
@ -680,7 +680,7 @@ filter_prep_response_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
}
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -700,7 +700,7 @@ filter_respond_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
*resp = ISC_R_UNSET;
|
||||
|
||||
if (client_state == NULL) {
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
if (client_state->mode != BREAK_DNSSEC &&
|
||||
|
|
@ -708,7 +708,7 @@ filter_respond_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
(WANTDNSSEC(qctx->client) && qctx->sigrdataset != NULL &&
|
||||
dns_rdataset_isassociated(qctx->sigrdataset))))
|
||||
{
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
if (qctx->qtype == dns_rdatatype_a) {
|
||||
|
|
@ -781,11 +781,11 @@ filter_respond_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
|
||||
*resp = result;
|
||||
|
||||
return (NS_HOOK_RETURN);
|
||||
return NS_HOOK_RETURN;
|
||||
}
|
||||
|
||||
*resp = result;
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -818,7 +818,7 @@ filter_respond_any_found(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
process_section(&filter_answer);
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -855,7 +855,7 @@ filter_query_done_send(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
}
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -870,10 +870,10 @@ filter_qctx_destroy(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
*resp = ISC_R_UNSET;
|
||||
|
||||
if (!qctx->detach_client) {
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
client_state_destroy(qctx, inst);
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ static const char *filter_aaaa_enums[] = { "break-dnssec", NULL };
|
|||
|
||||
static isc_result_t
|
||||
parse_filter_aaaa(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
|
||||
return (cfg_parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));
|
||||
return cfg_parse_enum_or_other(pctx, type, &cfg_type_boolean, ret);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -213,7 +213,7 @@ parse_filter_aaaa_on(const cfg_obj_t *param_obj, const char *param_name,
|
|||
|
||||
result = cfg_map_get(param_obj, param_name, &obj);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (cfg_obj_isboolean(obj)) {
|
||||
|
|
@ -228,7 +228,7 @@ parse_filter_aaaa_on(const cfg_obj_t *param_obj, const char *param_name,
|
|||
result = ISC_R_UNEXPECTED;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -241,7 +241,7 @@ check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, isc_log_t *lctx,
|
|||
|
||||
cfg_map_get(fmap, "filter-aaaa", &aclobj);
|
||||
if (aclobj == NULL) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
CHECK(cfg_acl_fromconfig(aclobj, (const cfg_obj_t *)cfg, lctx,
|
||||
|
|
@ -269,7 +269,7 @@ cleanup:
|
|||
dns_acl_detach(&acl);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -312,7 +312,7 @@ cleanup:
|
|||
if (parser != NULL) {
|
||||
cfg_parser_destroy(&parser);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -365,7 +365,7 @@ cleanup:
|
|||
plugin_destroy((void **)&inst);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -393,7 +393,7 @@ cleanup:
|
|||
if (parser != NULL) {
|
||||
cfg_parser_destroy(&parser);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -423,7 +423,7 @@ plugin_destroy(void **instp) {
|
|||
*/
|
||||
int
|
||||
plugin_version(void) {
|
||||
return (NS_PLUGIN_VERSION);
|
||||
return NS_PLUGIN_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -448,14 +448,14 @@ typedef struct section_filter {
|
|||
static bool
|
||||
is_v4_client(ns_client_t *client) {
|
||||
if (isc_sockaddr_pf(&client->peeraddr) == AF_INET) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (isc_sockaddr_pf(&client->peeraddr) == AF_INET6 &&
|
||||
IN6_IS_ADDR_V4MAPPED(&client->peeraddr.type.sin6.sin6_addr))
|
||||
{
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -466,9 +466,9 @@ is_v6_client(ns_client_t *client) {
|
|||
if (isc_sockaddr_pf(&client->peeraddr) == AF_INET6 &&
|
||||
!IN6_IS_ADDR_V4MAPPED(&client->peeraddr.type.sin6.sin6_addr))
|
||||
{
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
static filter_data_t *
|
||||
|
|
@ -481,7 +481,7 @@ client_state_get(const query_ctx_t *qctx, filter_instance_t *inst) {
|
|||
sizeof(qctx->client), (void **)&client_state);
|
||||
UNLOCK(&inst->hlock);
|
||||
|
||||
return (result == ISC_R_SUCCESS ? client_state : NULL);
|
||||
return result == ISC_R_SUCCESS ? client_state : NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -577,7 +577,7 @@ process_name(query_ctx_t *qctx, filter_aaaa_t mode, const dns_name_t *name,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (modified);
|
||||
return modified;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -648,7 +648,7 @@ filter_qctx_initialize(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
client_state_create(qctx, inst);
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -666,7 +666,7 @@ filter_prep_response_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
*resp = ISC_R_UNSET;
|
||||
|
||||
if (client_state == NULL) {
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
if (inst->v4_aaaa != NONE || inst->v6_aaaa != NONE) {
|
||||
|
|
@ -683,7 +683,7 @@ filter_prep_response_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
}
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -703,7 +703,7 @@ filter_respond_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
*resp = ISC_R_UNSET;
|
||||
|
||||
if (client_state == NULL) {
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
if (client_state->mode != BREAK_DNSSEC &&
|
||||
|
|
@ -711,7 +711,7 @@ filter_respond_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
(WANTDNSSEC(qctx->client) && qctx->sigrdataset != NULL &&
|
||||
dns_rdataset_isassociated(qctx->sigrdataset))))
|
||||
{
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
if (qctx->qtype == dns_rdatatype_aaaa) {
|
||||
|
|
@ -783,11 +783,11 @@ filter_respond_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
|
||||
*resp = result;
|
||||
|
||||
return (NS_HOOK_RETURN);
|
||||
return NS_HOOK_RETURN;
|
||||
}
|
||||
|
||||
*resp = result;
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -820,7 +820,7 @@ filter_respond_any_found(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
process_section(&filter_answer);
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -857,7 +857,7 @@ filter_query_done_send(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
}
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -872,10 +872,10 @@ filter_qctx_destroy(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
*resp = ISC_R_UNSET;
|
||||
|
||||
if (!qctx->detach_client) {
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
client_state_destroy(qctx, inst);
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1118,8 +1118,8 @@ main(int argc, char **argv) {
|
|||
isc_mem_destroy(&rndc_mctx);
|
||||
|
||||
if (failed) {
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,10 +104,10 @@ single_valued(const char *type) {
|
|||
|
||||
for (i = 0; single[i]; i++) {
|
||||
if (strcasecmp(single[i], type) == 0) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -141,14 +141,14 @@ add_name(struct dlz_example_data *state, struct record *list, const char *name,
|
|||
}
|
||||
if (i == MAX_RECORDS) {
|
||||
logerr("dlz_example: out of record space");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (strlen(name) >= sizeof(list[i].name) ||
|
||||
strlen(type) >= sizeof(list[i].type) ||
|
||||
strlen(data) >= sizeof(list[i].data))
|
||||
{
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
|
||||
strncpy(list[i].name, name, sizeof(list[i].name) - 1);
|
||||
|
|
@ -162,7 +162,7 @@ add_name(struct dlz_example_data *state, struct record *list, const char *name,
|
|||
|
||||
list[i].ttl = ttl;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -184,10 +184,10 @@ del_name(struct dlz_example_data *state, struct record *list, const char *name,
|
|||
}
|
||||
}
|
||||
if (i == MAX_RECORDS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
memset(&list[i], 0, sizeof(struct record));
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -208,15 +208,15 @@ fmt_address(isc_sockaddr_t *addr, char *buffer, size_t size) {
|
|||
sizeof(addr_buf));
|
||||
break;
|
||||
default:
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (ret == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
snprintf(buffer, size, "%s#%u", addr_buf, port);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -225,7 +225,7 @@ fmt_address(isc_sockaddr_t *addr, char *buffer, size_t size) {
|
|||
int
|
||||
dlz_version(unsigned int *flags) {
|
||||
UNUSED(flags);
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -265,7 +265,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
|
||||
state = calloc(1, sizeof(struct dlz_example_data));
|
||||
if (state == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/* Fill in the helper functions */
|
||||
|
|
@ -278,14 +278,14 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
if (argc < 2 || argv[1][0] == '\0') {
|
||||
logerr("dlz_example: please specify a zone name");
|
||||
dlz_destroy(state);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* Ensure zone name is absolute */
|
||||
state->zone_name = malloc(strlen(argv[1]) + 2);
|
||||
if (state->zone_name == NULL) {
|
||||
free(state);
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
if (argv[1][strlen(argv[1]) - 1] == '.') {
|
||||
strcpy(state->zone_name, argv[1]);
|
||||
|
|
@ -319,11 +319,11 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
loginfo("dlz_example: started for zone %s", state->zone_name);
|
||||
|
||||
*dbdata = state;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
failure:
|
||||
free(state);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -370,7 +370,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
* this; it will move onto the next database after a single query.
|
||||
*/
|
||||
if (strcasecmp(name, "test.example.com") == 0) {
|
||||
return (ISC_R_NOMORE);
|
||||
return ISC_R_NOMORE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -380,7 +380,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
if (strcasecmp(name, "test.example.net") == 0 &&
|
||||
strncmp(addrbuf, "10.53.0.1", 9) == 0)
|
||||
{
|
||||
return (ISC_R_NOMORE);
|
||||
return ISC_R_NOMORE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -389,7 +389,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
* zone origin nodes could fail to return SERVFAIL to the client.
|
||||
*/
|
||||
if (strcasecmp(name, "bigcname.domain") == 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -397,15 +397,15 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
* zone name and the qname
|
||||
*/
|
||||
if (strcasecmp(state->zone_name, name) == 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
snprintf(absolute, sizeof(absolute), "%s.", name);
|
||||
if (strcasecmp(state->zone_name, absolute) == 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -435,7 +435,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
UNUSED(zone);
|
||||
|
||||
if (state->putrr == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
if (strcmp(name, "@") == 0) {
|
||||
|
|
@ -451,7 +451,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
if (size < 0 || (size_t)size >= sizeof(full_name) ||
|
||||
(size_t)size >= sizeof(last))
|
||||
{
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -515,7 +515,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
found = true;
|
||||
result = state->putrr(lookup, "TXT", 0, buf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -529,7 +529,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
found = true;
|
||||
result = state->putrr(lookup, "TXT", 0, buf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -538,7 +538,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
result = state->putrr(lookup, "A", 0, "100.100.100.2");
|
||||
found = true;
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -548,7 +548,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
result = state->putrr(lookup, "A", 0, "100.100.100.3");
|
||||
found = true;
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -560,16 +560,16 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
state->current[i].ttl,
|
||||
state->current[i].data);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -586,7 +586,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
loginfo("dlz_example: findzonedb returned %s",
|
||||
isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -595,7 +595,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
*/
|
||||
if (strcmp(name, "example.org") == 0) {
|
||||
loginfo("dlz_example: use view ACL for example.org");
|
||||
return (ISC_R_DEFAULT);
|
||||
return ISC_R_DEFAULT;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -604,12 +604,12 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
*/
|
||||
if (strcmp(client, "10.53.0.5") == 0) {
|
||||
loginfo("dlz_example: disallow transfer to 10.53.0.5");
|
||||
return (ISC_R_NOPERM);
|
||||
return ISC_R_NOPERM;
|
||||
}
|
||||
|
||||
loginfo("dlz_example: transfer allowed for %s", name);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -623,7 +623,7 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
UNUSED(zone);
|
||||
|
||||
if (state->putnamedrr == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_RECORDS; i++) {
|
||||
|
|
@ -636,11 +636,11 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
state->current[i].ttl,
|
||||
state->current[i].data);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -653,13 +653,13 @@ dlz_newversion(const char *zone, void *dbdata, void **versionp) {
|
|||
if (state->transaction_started) {
|
||||
loginfo("dlz_example: transaction already started for zone %s",
|
||||
zone);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
state->transaction_started = true;
|
||||
*versionp = (void *)&state->transaction_started;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -720,18 +720,18 @@ dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata) {
|
|||
|
||||
if (state->writeable_zone == NULL) {
|
||||
loginfo("dlz_example: no writeable_zone method available");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = state->writeable_zone(view, dlzdb, state->zone_name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
loginfo("dlz_example: failed to configure zone %s",
|
||||
state->zone_name);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
loginfo("dlz_example: configured writeable zone %s", state->zone_name);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -752,10 +752,10 @@ dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
|
|||
if (strncmp(name, "deny.", 5) == 0) {
|
||||
loginfo("dlz_example: denying update of name=%s by %s", name,
|
||||
signer);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
loginfo("dlz_example: allowing update of name=%s by %s", name, signer);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -768,7 +768,7 @@ modrdataset(struct dlz_example_data *state, const char *name,
|
|||
|
||||
buf = strdup(rdatastr);
|
||||
if (buf == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -812,11 +812,11 @@ modrdataset(struct dlz_example_data *state, const char *name,
|
|||
result = add_name(state, list, name, type, strtoul(ttlstr, NULL, 10),
|
||||
data);
|
||||
free(buf);
|
||||
return (result);
|
||||
return result;
|
||||
|
||||
error:
|
||||
free(buf);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -825,12 +825,12 @@ dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
|
||||
|
||||
if (version != (void *)&state->transaction_started) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
loginfo("dlz_example: adding rdataset %s '%s'", name, rdatastr);
|
||||
|
||||
return (modrdataset(state, name, rdatastr, &state->adds[0]));
|
||||
return modrdataset(state, name, rdatastr, &state->adds[0]);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -839,12 +839,12 @@ dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
|
||||
|
||||
if (version != (void *)&state->transaction_started) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
loginfo("dlz_example: subtracting rdataset %s '%s'", name, rdatastr);
|
||||
|
||||
return (modrdataset(state, name, rdatastr, &state->deletes[0]));
|
||||
return modrdataset(state, name, rdatastr, &state->deletes[0]);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -853,10 +853,10 @@ dlz_delrdataset(const char *name, const char *type, void *dbdata,
|
|||
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
|
||||
|
||||
if (version != (void *)&state->transaction_started) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
loginfo("dlz_example: deleting rdataset %s of type %s", name, type);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ typedef struct sampledb sampledb_t;
|
|||
static isc_result_t
|
||||
sample_name_fromnode(dns_dbnode_t *node, dns_name_t *name) {
|
||||
dns_rbtnode_t *rbtnode = (dns_rbtnode_t *)node;
|
||||
return (dns_rbt_fullnamefromnode(rbtnode, name));
|
||||
return dns_rbt_fullnamefromnode(rbtnode, name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -136,7 +136,7 @@ beginload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
|||
FATAL_ERROR("current implementation should never call beginload()");
|
||||
|
||||
/* Not reached */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -152,7 +152,7 @@ endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
|||
FATAL_ERROR("current implementation should never call endload()");
|
||||
|
||||
/* Not reached */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -166,7 +166,7 @@ dump(dns_db_t *db, dns_dbversion_t *version, const char *filename,
|
|||
FATAL_ERROR("current implementation should never call dump()");
|
||||
|
||||
/* Not reached */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -184,7 +184,7 @@ newversion(dns_db_t *db, dns_dbversion_t **versionp) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_newversion(sampledb->rbtdb, versionp));
|
||||
return dns_db_newversion(sampledb->rbtdb, versionp);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -213,7 +213,7 @@ findnode(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_findnode(sampledb->rbtdb, name, create, nodep));
|
||||
return dns_db_findnode(sampledb->rbtdb, name, create, nodep);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -225,8 +225,8 @@ find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_find(sampledb->rbtdb, name, version, type, options, now,
|
||||
nodep, foundname, rdataset, sigrdataset));
|
||||
return dns_db_find(sampledb->rbtdb, name, version, type, options, now,
|
||||
nodep, foundname, rdataset, sigrdataset);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -238,8 +238,8 @@ findzonecut(dns_db_t *db, const dns_name_t *name, unsigned int options,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_findzonecut(sampledb->rbtdb, name, options, now, nodep,
|
||||
foundname, dcname, rdataset, sigrdataset));
|
||||
return dns_db_findzonecut(sampledb->rbtdb, name, options, now, nodep,
|
||||
foundname, dcname, rdataset, sigrdataset);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -266,7 +266,7 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_expirenode(sampledb->rbtdb, node, now));
|
||||
return dns_db_expirenode(sampledb->rbtdb, node, now);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -285,7 +285,7 @@ createiterator(dns_db_t *db, unsigned int options,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_createiterator(sampledb->rbtdb, options, iteratorp));
|
||||
return dns_db_createiterator(sampledb->rbtdb, options, iteratorp);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -296,8 +296,8 @@ findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_findrdataset(sampledb->rbtdb, node, version, type,
|
||||
covers, now, rdataset, sigrdataset));
|
||||
return dns_db_findrdataset(sampledb->rbtdb, node, version, type, covers,
|
||||
now, rdataset, sigrdataset);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -308,8 +308,8 @@ allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_allrdatasets(sampledb->rbtdb, node, version, options,
|
||||
now, iteratorp));
|
||||
return dns_db_allrdatasets(sampledb->rbtdb, node, version, options, now,
|
||||
iteratorp);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -334,7 +334,7 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -363,7 +363,7 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -377,8 +377,8 @@ deleterdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_deleterdataset(sampledb->rbtdb, node, version, type,
|
||||
covers));
|
||||
return dns_db_deleterdataset(sampledb->rbtdb, node, version, type,
|
||||
covers);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -387,7 +387,7 @@ issecure(dns_db_t *db) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_issecure(sampledb->rbtdb));
|
||||
return dns_db_issecure(sampledb->rbtdb);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
|
|
@ -396,7 +396,7 @@ nodecount(dns_db_t *db, dns_dbtree_t tree) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_nodecount(sampledb->rbtdb, tree));
|
||||
return dns_db_nodecount(sampledb->rbtdb, tree);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -407,7 +407,7 @@ static bool
|
|||
ispersistent(dns_db_t *db) {
|
||||
UNUSED(db);
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -434,7 +434,7 @@ getoriginnode(dns_db_t *db, dns_dbnode_t **nodep) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_getoriginnode(sampledb->rbtdb, nodep));
|
||||
return dns_db_getoriginnode(sampledb->rbtdb, nodep);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -454,8 +454,8 @@ getnsec3parameters(dns_db_t *db, dns_dbversion_t *version, dns_hash_t *hash,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_getnsec3parameters(sampledb->rbtdb, version, hash, flags,
|
||||
iterations, salt, salt_length));
|
||||
return dns_db_getnsec3parameters(sampledb->rbtdb, version, hash, flags,
|
||||
iterations, salt, salt_length);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -465,7 +465,7 @@ findnsec3node(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_findnsec3node(sampledb->rbtdb, name, create, nodep));
|
||||
return dns_db_findnsec3node(sampledb->rbtdb, name, create, nodep);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -474,7 +474,7 @@ setsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, isc_stdtime_t resign) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_setsigningtime(sampledb->rbtdb, rdataset, resign));
|
||||
return dns_db_setsigningtime(sampledb->rbtdb, rdataset, resign);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -483,7 +483,7 @@ getsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, dns_name_t *name) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_getsigningtime(sampledb->rbtdb, rdataset, name));
|
||||
return dns_db_getsigningtime(sampledb->rbtdb, rdataset, name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -501,7 +501,7 @@ isdnssec(dns_db_t *db) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_isdnssec(sampledb->rbtdb));
|
||||
return dns_db_isdnssec(sampledb->rbtdb);
|
||||
}
|
||||
|
||||
static dns_stats_t *
|
||||
|
|
@ -510,7 +510,7 @@ getrrsetstats(dns_db_t *db) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_getrrsetstats(sampledb->rbtdb));
|
||||
return dns_db_getrrsetstats(sampledb->rbtdb);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -521,8 +521,8 @@ findnodeext(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_findnodeext(sampledb->rbtdb, name, create, methods,
|
||||
clientinfo, nodep));
|
||||
return dns_db_findnodeext(sampledb->rbtdb, name, create, methods,
|
||||
clientinfo, nodep);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -535,9 +535,9 @@ findext(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_findext(sampledb->rbtdb, name, version, type, options,
|
||||
now, nodep, foundname, methods, clientinfo,
|
||||
rdataset, sigrdataset));
|
||||
return dns_db_findext(sampledb->rbtdb, name, version, type, options,
|
||||
now, nodep, foundname, methods, clientinfo,
|
||||
rdataset, sigrdataset);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -546,7 +546,7 @@ setcachestats(dns_db_t *db, isc_stats_t *stats) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_setcachestats(sampledb->rbtdb, stats));
|
||||
return dns_db_setcachestats(sampledb->rbtdb, stats);
|
||||
}
|
||||
|
||||
static size_t
|
||||
|
|
@ -555,7 +555,7 @@ hashsize(dns_db_t *db) {
|
|||
|
||||
REQUIRE(VALID_SAMPLEDB(sampledb));
|
||||
|
||||
return (dns_db_hashsize(sampledb->rbtdb));
|
||||
return dns_db_hashsize(sampledb->rbtdb);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -653,7 +653,7 @@ cleanup:
|
|||
if (node != NULL) {
|
||||
dns_db_detachnode(db, &node);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -691,7 +691,7 @@ cleanup:
|
|||
if (node != NULL) {
|
||||
dns_db_detachnode(db, &node);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -727,7 +727,7 @@ cleanup:
|
|||
if (node != NULL) {
|
||||
dns_db_detachnode(db, &node);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -789,7 +789,7 @@ create_db(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
|||
|
||||
*dbp = (dns_db_t *)sampledb;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
if (sampledb != NULL) {
|
||||
|
|
@ -801,5 +801,5 @@ cleanup:
|
|||
sizeof(*sampledb));
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ cleanup:
|
|||
isc_mem_put(mctx, argv, argc * sizeof(*argv));
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -160,5 +160,5 @@ int
|
|||
dyndb_version(unsigned int *flags) {
|
||||
UNUSED(flags);
|
||||
|
||||
return (DNS_DYNDB_VERSION);
|
||||
return DNS_DYNDB_VERSION;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ parse_params(isc_mem_t *mctx, int argc, char **argv, dns_name_t *z1,
|
|||
result = ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -154,7 +154,7 @@ cleanup:
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
destroy_sample_instance(&inst);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -196,7 +196,7 @@ load_sample_instance_zones(sample_instance_t *inst) {
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ cleanup:
|
|||
dns_rdata_freestruct(&ipv6);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -302,7 +302,7 @@ cleanup:
|
|||
isc_event_free((isc_event_t **)&pevent);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -333,5 +333,5 @@ syncptrs(sample_instance_t *inst, dns_name_t *name, dns_rdataset_t *rdataset,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ create_zone(sample_instance_t *const inst, dns_name_t *const name,
|
|||
dns_acl_detach(&acl_any);
|
||||
|
||||
*rawp = raw;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
dns_name_format(name, zone_name, DNS_NAME_FORMATSIZE);
|
||||
|
|
@ -121,7 +121,7 @@ cleanup:
|
|||
dns_acl_detach(&acl_any);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -196,7 +196,7 @@ cleanup:
|
|||
}
|
||||
run_exclusive_exit(inst, lock_state);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -231,7 +231,7 @@ load_zone(dns_zone_t *zone) {
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -261,5 +261,5 @@ activate_zone(sample_instance_t *inst, dns_zone_t *raw) {
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ int
|
|||
main(int argc, char **argv) {
|
||||
if (argc != 2) {
|
||||
usage();
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--edns-version") == 0) {
|
||||
|
|
@ -60,30 +60,30 @@ main(int argc, char **argv) {
|
|||
#else /* ifdef DNS_EDNS_VERSION */
|
||||
printf("0\n");
|
||||
#endif /* ifdef DNS_EDNS_VERSION */
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--enable-dnsrps") == 0) {
|
||||
#ifdef USE_DNSRPS
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef USE_DNSRPS */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef USE_DNSRPS */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--enable-dnstap") == 0) {
|
||||
#ifdef HAVE_DNSTAP
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef HAVE_DNSTAP */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef HAVE_DNSTAP */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--enable-querytrace") == 0) {
|
||||
#ifdef WANT_QUERYTRACE
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef WANT_QUERYTRACE */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef WANT_QUERYTRACE */
|
||||
}
|
||||
|
||||
|
|
@ -94,54 +94,54 @@ main(int argc, char **argv) {
|
|||
n = gethostname(hostname, sizeof(hostname));
|
||||
if (n == -1) {
|
||||
perror("gethostname");
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
fprintf(stdout, "%s\n", hostname);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--gssapi") == 0) {
|
||||
#if HAVE_GSSAPI
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* HAVE_GSSAPI */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* HAVE_GSSAPI */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--have-geoip2") == 0) {
|
||||
#ifdef HAVE_GEOIP2
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef HAVE_GEOIP2 */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef HAVE_GEOIP2 */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--have-json-c") == 0) {
|
||||
#ifdef HAVE_JSON_C
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef HAVE_JSON_C */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef HAVE_JSON_C */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--have-libxml2") == 0) {
|
||||
#ifdef HAVE_LIBXML2
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef HAVE_LIBXML2 */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef HAVE_LIBXML2 */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--tsan") == 0) {
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(thread_sanitizer)
|
||||
return (0);
|
||||
return 0;
|
||||
#endif
|
||||
#endif
|
||||
#if __SANITIZE_THREAD__
|
||||
return (0);
|
||||
return 0;
|
||||
#else
|
||||
return (1);
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -153,9 +153,9 @@ main(int argc, char **argv) {
|
|||
if (isc_md(ISC_MD_MD5, test, sizeof(test), digest, &size) ==
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
return (0);
|
||||
return 0;
|
||||
} else {
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -172,53 +172,53 @@ main(int argc, char **argv) {
|
|||
(void *)&v6only, &len);
|
||||
close(s);
|
||||
}
|
||||
return ((n == 0 && v6only == 0) ? 0 : 1);
|
||||
return (n == 0 && v6only == 0) ? 0 : 1;
|
||||
#else /* defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY) */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY) */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--with-dlz-filesystem") == 0) {
|
||||
#ifdef DLZ_FILESYSTEM
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef DLZ_FILESYSTEM */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef DLZ_FILESYSTEM */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--with-libidn2") == 0) {
|
||||
#ifdef HAVE_LIBIDN2
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef HAVE_LIBIDN2 */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef HAVE_LIBIDN2 */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--with-lmdb") == 0) {
|
||||
#ifdef HAVE_LMDB
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef HAVE_LMDB */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef HAVE_LMDB */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--with-libnghttp2") == 0) {
|
||||
#ifdef HAVE_LIBNGHTTP2
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef HAVE_LIBNGHTTP2 */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef HAVE_LIBNGHTTP2 */
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--with-zlib") == 0) {
|
||||
#ifdef HAVE_ZLIB
|
||||
return (0);
|
||||
return 0;
|
||||
#else /* ifdef HAVE_ZLIB */
|
||||
return (1);
|
||||
return 1;
|
||||
#endif /* ifdef HAVE_ZLIB */
|
||||
}
|
||||
|
||||
fprintf(stderr, "unknown arg: %s\n", argv[1]);
|
||||
usage();
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
|
|||
|
||||
*instp = inst;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -168,7 +168,7 @@ plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
|
|||
UNUSED(lctx);
|
||||
UNUSED(actx);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -195,7 +195,7 @@ plugin_destroy(void **instp) {
|
|||
*/
|
||||
int
|
||||
plugin_version(void) {
|
||||
return (NS_PLUGIN_VERSION);
|
||||
return NS_PLUGIN_VERSION;
|
||||
}
|
||||
|
||||
static state_t *
|
||||
|
|
@ -208,7 +208,7 @@ client_state_get(const query_ctx_t *qctx, async_instance_t *inst) {
|
|||
sizeof(qctx->client), (void **)&state);
|
||||
UNLOCK(&inst->hlock);
|
||||
|
||||
return (result == ISC_R_SUCCESS ? state : NULL);
|
||||
return result == ISC_R_SUCCESS ? state : NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -258,7 +258,7 @@ async_qctx_initialize(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
client_state_create(qctx, inst);
|
||||
}
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -302,7 +302,7 @@ doasync(query_ctx_t *qctx, isc_mem_t *mctx, void *arg, isc_task_t *task,
|
|||
isc_task_send(task, (isc_event_t **)&rev);
|
||||
|
||||
*ctxp = ctx;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static ns_hookresult_t
|
||||
|
|
@ -319,7 +319,7 @@ async_query_done_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
if (state->async) {
|
||||
/* resuming */
|
||||
state->async = false;
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
/* initial call */
|
||||
|
|
@ -327,7 +327,7 @@ async_query_done_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
state->hookpoint = NS_QUERY_DONE_BEGIN;
|
||||
state->origresult = *resp;
|
||||
ns_query_hookasync(qctx, doasync, state);
|
||||
return (NS_HOOK_RETURN);
|
||||
return NS_HOOK_RETURN;
|
||||
}
|
||||
|
||||
static ns_hookresult_t
|
||||
|
|
@ -339,10 +339,10 @@ async_qctx_destroy(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
*resp = ISC_R_UNSET;
|
||||
|
||||
if (!qctx->detach_client) {
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
client_state_destroy(qctx, inst);
|
||||
|
||||
return (NS_HOOK_CONTINUE);
|
||||
return NS_HOOK_CONTINUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,17 +65,17 @@ loadzone(dns_db_t **db, const char *origin, const char *filename) {
|
|||
|
||||
result = dns_name_fromstring(name, origin, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = dns_db_create(mctx, "rbt", name, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, db);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = dns_db_load(*db, filename, dns_masterformat_text, 0);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -88,7 +88,7 @@ main(int argc, char **argv) {
|
|||
|
||||
if (argc != 5) {
|
||||
printf("usage: %s origin file1 file2 journal\n", argv[0]);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
origin = argv[1];
|
||||
|
|
@ -154,5 +154,5 @@ cleanup:
|
|||
isc_mem_destroy(&mctx);
|
||||
}
|
||||
|
||||
return (result != ISC_R_SUCCESS ? 1 : 0);
|
||||
return result != ISC_R_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ sendquery(isc_task_t *task) {
|
|||
|
||||
c = scanf("%255s", host);
|
||||
if (c == EOF) {
|
||||
return (ISC_R_NOMORE);
|
||||
return ISC_R_NOMORE;
|
||||
}
|
||||
|
||||
onfly++;
|
||||
|
|
@ -175,7 +175,7 @@ sendquery(isc_task_t *task) {
|
|||
task, recvresponse, message, &request);
|
||||
CHECK("dns_request_create", result);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -299,5 +299,5 @@ main(int argc, char *argv[]) {
|
|||
|
||||
isc_app_finish();
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,12 +93,12 @@ ctxs_init(void) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
fail:
|
||||
ctxs_destroy();
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static char *algname = NULL;
|
||||
|
|
@ -112,19 +112,19 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner) {
|
|||
|
||||
if (!dns_rdataset_isassociated(rdataset)) {
|
||||
printf("[WARN: empty]\n");
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
isc_buffer_init(&target, t, sizeof(t));
|
||||
|
||||
result = dns_rdataset_totext(rdataset, owner, false, false, &target);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
isc_buffer_usedregion(&target, &r);
|
||||
printf("%.*s", (int)r.length, (char *)r.base);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
noreturn static void
|
||||
|
|
@ -501,5 +501,5 @@ cleanup:
|
|||
ctxs_destroy();
|
||||
dst_lib_destroy();
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ check(const char *buf, ssize_t count, size_t *start) {
|
|||
continue;
|
||||
}
|
||||
if (buf[i] != chars[*start]) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -86,5 +86,5 @@ out:
|
|||
close(fd);
|
||||
}
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,26 +71,26 @@ main(int argc, char **argv) {
|
|||
case 'a':
|
||||
if (!link_dnsrps(&emsg)) {
|
||||
printf("I:%s\n", emsg.c);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
case 'p':
|
||||
if (!link_dnsrps(&emsg)) {
|
||||
fprintf(stderr, "## %s\n", emsg.c);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
#ifdef USE_DNSRPS
|
||||
printf("%s\n", librpz->dnsrpzd_path);
|
||||
#else /* ifdef USE_DNSRPS */
|
||||
UNREACHABLE();
|
||||
#endif /* ifdef USE_DNSRPS */
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
case 'n':
|
||||
if (!link_dnsrps(&emsg)) {
|
||||
fprintf(stderr, "## %s\n", emsg.c);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
#ifdef USE_DNSRPS
|
||||
/*
|
||||
|
|
@ -101,7 +101,7 @@ main(int argc, char **argv) {
|
|||
NULL, NULL);
|
||||
if (clist == NULL) {
|
||||
fprintf(stderr, "## %s: %s\n", optarg, emsg.c);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
snprintf(cstr, sizeof(cstr),
|
||||
"zone %s; dnsrpzd \"\";"
|
||||
|
|
@ -112,7 +112,7 @@ main(int argc, char **argv) {
|
|||
true);
|
||||
if (client == NULL) {
|
||||
fprintf(stderr, "## %s\n", emsg.c);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
rsp = NULL;
|
||||
|
|
@ -122,13 +122,13 @@ main(int argc, char **argv) {
|
|||
{
|
||||
fprintf(stderr, "## %s\n", emsg.c);
|
||||
librpz->client_detach(&client);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!librpz->soa_serial(&emsg, &serial, optarg, rsp)) {
|
||||
fprintf(stderr, "## %s\n", emsg.c);
|
||||
librpz->client_detach(&client);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
librpz->rsp_detach(&rsp);
|
||||
librpz->client_detach(&client);
|
||||
|
|
@ -136,24 +136,24 @@ main(int argc, char **argv) {
|
|||
#else /* ifdef USE_DNSRPS */
|
||||
UNREACHABLE();
|
||||
#endif /* ifdef USE_DNSRPS */
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
case 'w':
|
||||
seconds = strtod(optarg, &p);
|
||||
if (seconds <= 0 || *p != '\0') {
|
||||
fprintf(stderr, USAGE);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
usleep((int)(seconds * 1000.0 * 1000.0));
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
default:
|
||||
fprintf(stderr, USAGE);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, USAGE);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -161,12 +161,12 @@ link_dnsrps(librpz_emsg_t *emsg) {
|
|||
#ifdef USE_DNSRPS
|
||||
librpz = librpz_lib_open(emsg, NULL, DNSRPS_LIBRPZ_PATH);
|
||||
if (librpz == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
#else /* ifdef USE_DNSRPS */
|
||||
snprintf(emsg->c, sizeof(emsg->c), "DNSRPS not configured");
|
||||
return (false);
|
||||
return false;
|
||||
#endif /* ifdef USE_DNSRPS */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ main(int argc, char **argv) {
|
|||
dns_log_setcontext(NULL);
|
||||
dst_lib_destroy();
|
||||
isc_mem_destroy(&mctx);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \file */
|
||||
|
|
|
|||
|
|
@ -274,5 +274,5 @@ main(int argc, char *argv[]) {
|
|||
|
||||
isc_app_finish();
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,5 +217,5 @@ main(int argc, char **argv) {
|
|||
|
||||
isc_app_finish();
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,12 +73,12 @@ parse_port(const char *input) {
|
|||
long val = strtol(input, &endptr, 10);
|
||||
|
||||
if ((*endptr != '\0') || (val <= 0) || (val >= 65536)) {
|
||||
return (ISC_R_BADNUMBER);
|
||||
return ISC_R_BADNUMBER;
|
||||
}
|
||||
|
||||
port = input;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -86,11 +86,11 @@ parse_protocol(const char *input) {
|
|||
for (size_t i = 0; i < ARRAY_SIZE(protocols); i++) {
|
||||
if (!strcasecmp(input, protocols[i])) {
|
||||
protocol = i;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return (ISC_R_BADNUMBER);
|
||||
return ISC_R_BADNUMBER;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -101,16 +101,16 @@ parse_address(const char *input) {
|
|||
if (inet_pton(AF_INET6, input, &in6) == 1) {
|
||||
family = AF_INET6;
|
||||
address = input;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (inet_pton(AF_INET, input, &in) == 1) {
|
||||
family = AF_INET;
|
||||
address = input;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (ISC_R_BADADDRESSFORM);
|
||||
return ISC_R_BADADDRESSFORM;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -119,12 +119,12 @@ parse_workers(const char *input) {
|
|||
long val = strtol(input, &endptr, 10);
|
||||
|
||||
if ((*endptr != '\0') || (val <= 0) || (val >= 128)) {
|
||||
return (ISC_R_BADNUMBER);
|
||||
return ISC_R_BADNUMBER;
|
||||
}
|
||||
|
||||
workers = val;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -133,12 +133,12 @@ parse_timeout(const char *input) {
|
|||
long val = strtol(input, &endptr, 10);
|
||||
|
||||
if ((*endptr != '\0') || (val <= 0) || (val >= 120)) {
|
||||
return (ISC_R_BADNUMBER);
|
||||
return ISC_R_BADNUMBER;
|
||||
}
|
||||
|
||||
timeout = (in_port_t)val * 1000;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -156,7 +156,7 @@ parse_input(const char *input) {
|
|||
|
||||
close(in);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -169,7 +169,7 @@ parse_output(const char *input) {
|
|||
}
|
||||
RUNTIME_CHECK(out >= 0);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -449,5 +449,5 @@ main(int argc, char **argv) {
|
|||
|
||||
teardown();
|
||||
|
||||
return (EXIT_SUCCESS);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,12 +55,12 @@ parse_port(const char *input) {
|
|||
long val = strtol(input, &endptr, 10);
|
||||
|
||||
if ((*endptr != '\0') || (val <= 0) || (val >= 65536)) {
|
||||
return (ISC_R_BADNUMBER);
|
||||
return ISC_R_BADNUMBER;
|
||||
}
|
||||
|
||||
port = (in_port_t)val;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -68,11 +68,11 @@ parse_protocol(const char *input) {
|
|||
for (size_t i = 0; i < ARRAY_SIZE(protocols); i++) {
|
||||
if (!strcasecmp(input, protocols[i])) {
|
||||
protocol = i;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return (ISC_R_BADNUMBER);
|
||||
return ISC_R_BADNUMBER;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -82,15 +82,15 @@ parse_address(const char *input) {
|
|||
|
||||
if (inet_pton(AF_INET6, input, &in6) == 1) {
|
||||
isc_netaddr_fromin6(&netaddr, &in6);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (inet_pton(AF_INET, input, &in) == 1) {
|
||||
isc_netaddr_fromin(&netaddr, &in);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (ISC_R_BADADDRESSFORM);
|
||||
return ISC_R_BADADDRESSFORM;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -99,12 +99,12 @@ parse_workers(const char *input) {
|
|||
long val = strtol(input, &endptr, 10);
|
||||
|
||||
if ((*endptr != '\0') || (val <= 0) || (val >= 128)) {
|
||||
return (ISC_R_BADNUMBER);
|
||||
return ISC_R_BADNUMBER;
|
||||
}
|
||||
|
||||
workers = val;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -256,7 +256,7 @@ accept_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) {
|
|||
REQUIRE(eresult == ISC_R_SUCCESS);
|
||||
UNUSED(cbarg);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -322,5 +322,5 @@ main(int argc, char **argv) {
|
|||
|
||||
teardown();
|
||||
|
||||
return (EXIT_SUCCESS);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,11 +49,11 @@ CHECKRESULT(isc_result_t result, const char *msg) {
|
|||
static int
|
||||
fromhex(char c) {
|
||||
if (c >= '0' && c <= '9') {
|
||||
return (c - '0');
|
||||
return c - '0';
|
||||
} else if (c >= 'a' && c <= 'f') {
|
||||
return (c - 'a' + 10);
|
||||
return c - 'a' + 10;
|
||||
} else if (c >= 'A' && c <= 'F') {
|
||||
return (c - 'A' + 10);
|
||||
return c - 'A' + 10;
|
||||
}
|
||||
|
||||
fprintf(stderr, "bad input format: %02x\n", c);
|
||||
|
|
@ -98,7 +98,7 @@ printmessage(dns_message_t *msg) {
|
|||
isc_mem_put(mctx, buf, len);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -261,7 +261,7 @@ main(int argc, char *argv[]) {
|
|||
}
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ main(int argc, char *argv[]) {
|
|||
argv++;
|
||||
continue;
|
||||
}
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
fflush(stdout);
|
||||
return (ferror(stdout));
|
||||
return ferror(stdout);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ rcode_totext(dns_rcode_t rcode) {
|
|||
} else {
|
||||
totext.consttext = rcodetext[rcode];
|
||||
}
|
||||
return (totext.deconsttext);
|
||||
return totext.deconsttext;
|
||||
}
|
||||
|
||||
/* receive response event handler */
|
||||
|
|
@ -758,7 +758,7 @@ sendquery(struct query *query, isc_task_t *task) {
|
|||
query->udpretries, task, recvresponse, message, &request);
|
||||
CHECK("dns_request_create", result);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -915,20 +915,20 @@ parse_uint_helper(uint32_t *uip, const char *value, uint32_t max,
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
printf("invalid %s '%s': %s\n", desc, value,
|
||||
isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
*uip = n;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
parse_uint(uint32_t *uip, const char *value, uint32_t max, const char *desc) {
|
||||
return (parse_uint_helper(uip, value, max, desc, 10));
|
||||
return parse_uint_helper(uip, value, max, desc, 10);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
parse_xint(uint32_t *uip, const char *value, uint32_t max, const char *desc) {
|
||||
return (parse_uint_helper(uip, value, max, desc, 0));
|
||||
return parse_uint_helper(uip, value, max, desc, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1046,7 +1046,7 @@ parse_netprefix(isc_sockaddr_t **sap, const char *value) {
|
|||
sa->length = netmask;
|
||||
*sap = sa;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -1056,11 +1056,11 @@ parse_netprefix(isc_sockaddr_t **sap, const char *value) {
|
|||
static isc_result_t
|
||||
append(const char *text, int len, char **p, char *end) {
|
||||
if (len > end - *p) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
memmove(*p, text, len);
|
||||
*p += len;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1077,7 +1077,7 @@ reverse_octets(const char *in, char **p, char *end) {
|
|||
} else {
|
||||
len = strlen(in);
|
||||
}
|
||||
return (append(in, len, p, end));
|
||||
return append(in, len, p, end);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1687,7 +1687,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
|
|||
} else {
|
||||
fatal("can't find IPv4 networking");
|
||||
UNREACHABLE();
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case '6':
|
||||
|
|
@ -1698,7 +1698,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
|
|||
} else {
|
||||
fatal("can't find IPv6 networking");
|
||||
UNREACHABLE();
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'h':
|
||||
|
|
@ -1721,7 +1721,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
|
|||
if (strlen(option) > 1U) {
|
||||
option = &option[1];
|
||||
} else {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
opt = option[0];
|
||||
|
|
@ -1764,7 +1764,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
|
|||
*hash = '#';
|
||||
}
|
||||
have_src = true;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'c':
|
||||
tr.base = value;
|
||||
tr.length = strlen(value);
|
||||
|
|
@ -1772,16 +1772,16 @@ dash_option(const char *option, char *next, struct query *query, bool global,
|
|||
(isc_textregion_t *)&tr);
|
||||
CHECK("dns_rdataclass_fromtext", result);
|
||||
query->rdclass = rdclass;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'f':
|
||||
batchname = value;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'p':
|
||||
GLOBAL();
|
||||
result = parse_uint(&num, value, MAXPORT, "port number");
|
||||
CHECK("parse_uint(port)", result);
|
||||
port = num;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 't':
|
||||
tr.base = value;
|
||||
tr.length = strlen(value);
|
||||
|
|
@ -1789,14 +1789,14 @@ dash_option(const char *option, char *next, struct query *query, bool global,
|
|||
(isc_textregion_t *)&tr);
|
||||
CHECK("dns_rdatatype_fromtext", result);
|
||||
query->rdtype = rdtype;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
case 'x':
|
||||
get_reverse(textname, sizeof(textname), value);
|
||||
strlcpy(query->textname, textname, sizeof(query->textname));
|
||||
query->rdtype = dns_rdatatype_ptr;
|
||||
query->rdclass = dns_rdataclass_in;
|
||||
*setname = true;
|
||||
return (value_from_next);
|
||||
return value_from_next;
|
||||
global_option:
|
||||
fprintf(stderr, "Ignored late global option: -%s\n", option);
|
||||
usage();
|
||||
|
|
@ -1806,7 +1806,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
|
|||
usage();
|
||||
}
|
||||
UNREACHABLE();
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
static struct query *
|
||||
|
|
@ -1826,7 +1826,7 @@ clone_default_query(void) {
|
|||
query->timeout = tcp_mode ? TCPTIMEOUT : UDPTIMEOUT;
|
||||
}
|
||||
|
||||
return (query);
|
||||
return query;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2247,5 +2247,5 @@ main(int argc, char *argv[]) {
|
|||
|
||||
isc_app_finish();
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ setup_logging(isc_mem_t *mctx, FILE *errout, isc_log_t **logp) {
|
|||
ISC_R_SUCCESS);
|
||||
|
||||
*logp = log;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -130,5 +130,5 @@ main(int argc, char **argv) {
|
|||
}
|
||||
isc_log_destroy(&lctx);
|
||||
isc_mem_detach(&mctx);
|
||||
return (result != ISC_R_SUCCESS ? 1 : 0);
|
||||
return result != ISC_R_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,5 +99,5 @@ main(int argc, char *argv[]) {
|
|||
mdb_txn_abort(txn);
|
||||
mdb_env_close(env);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,5 +343,5 @@ main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
cleanup();
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,5 +191,5 @@ skip:
|
|||
nsec3hash(nsec3hash_print, argv[1], NULL, argv[2], argv[0],
|
||||
argv[3]);
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,10 +71,10 @@ single_valued(const char *type) {
|
|||
|
||||
for (i = 0; single[i]; i++) {
|
||||
if (strcasecmp(single[i], type) == 0) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -110,14 +110,14 @@ add_name(struct dlz_example_data *state, struct record *list, const char *name,
|
|||
state->log(ISC_LOG_ERROR, "dlz_example: out of record "
|
||||
"space");
|
||||
}
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (strlen(name) >= sizeof(list[i].name) ||
|
||||
strlen(type) >= sizeof(list[i].type) ||
|
||||
strlen(data) >= sizeof(list[i].data))
|
||||
{
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
|
||||
strncpy(list[i].name, name, sizeof(list[i].name));
|
||||
|
|
@ -131,7 +131,7 @@ add_name(struct dlz_example_data *state, struct record *list, const char *name,
|
|||
|
||||
list[i].ttl = ttl;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -153,10 +153,10 @@ del_name(struct dlz_example_data *state, struct record *list, const char *name,
|
|||
}
|
||||
}
|
||||
if (i == MAX_RECORDS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
memset(&list[i], 0, sizeof(struct record));
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -177,15 +177,15 @@ fmt_address(isc_sockaddr_t *addr, char *buffer, size_t size) {
|
|||
sizeof(addr_buf));
|
||||
break;
|
||||
default:
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (ret == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
snprintf(buffer, size, "%s#%u", addr_buf, port);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -194,7 +194,7 @@ fmt_address(isc_sockaddr_t *addr, char *buffer, size_t size) {
|
|||
int
|
||||
dlz_version(unsigned int *flags) {
|
||||
UNUSED(flags);
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -235,7 +235,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
|
||||
state = calloc(1, sizeof(struct dlz_example_data));
|
||||
if (state == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/* Fill in the helper functions */
|
||||
|
|
@ -251,14 +251,14 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
"a zone name");
|
||||
}
|
||||
dlz_destroy(state);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* Ensure zone name is absolute */
|
||||
state->zone_name = malloc(strlen(argv[1]) + 2);
|
||||
if (state->zone_name == NULL) {
|
||||
free(state);
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
if (argv[1][strlen(argv[1]) - 1] == '.') {
|
||||
strcpy(state->zone_name, argv[1]);
|
||||
|
|
@ -295,11 +295,11 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
}
|
||||
|
||||
*dbdata = state;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
failure:
|
||||
free(state);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -352,7 +352,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
* this; it will move onto the next database after a single query.
|
||||
*/
|
||||
if (strcasecmp(name, "test.example.com") == 0) {
|
||||
return (ISC_R_NOMORE);
|
||||
return ISC_R_NOMORE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -362,19 +362,19 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
if (strcasecmp(name, "test.example.net") == 0 &&
|
||||
strncmp(addrbuf, "10.53.0.1", 9) == 0)
|
||||
{
|
||||
return (ISC_R_NOMORE);
|
||||
return ISC_R_NOMORE;
|
||||
}
|
||||
|
||||
if (strcasecmp(state->zone_name, name) == 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
snprintf(absolute, sizeof(absolute), "%s.", name);
|
||||
if (strcasecmp(state->zone_name, absolute) == 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -403,7 +403,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
UNUSED(zone);
|
||||
|
||||
if (state->putrr == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
if (strcmp(name, "@") == 0) {
|
||||
|
|
@ -469,7 +469,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
snprintf(buf, sizeof(buf), "%s.redirect.example.", ecsbuf);
|
||||
result = state->putrr(lookup, "CNAME", 0, buf); */
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -481,7 +481,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
found = true;
|
||||
result = state->putrr(lookup, "TXT", 0, buf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -492,16 +492,16 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
state->current[i].ttl,
|
||||
state->current[i].data);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -512,7 +512,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
UNUSED(client);
|
||||
|
||||
/* Just say yes for all our zones */
|
||||
return (dlz_findzonedb(dbdata, name, NULL, NULL));
|
||||
return dlz_findzonedb(dbdata, name, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -526,7 +526,7 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
UNUSED(zone);
|
||||
|
||||
if (state->putnamedrr == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_RECORDS; i++) {
|
||||
|
|
@ -539,11 +539,11 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
state->current[i].ttl,
|
||||
state->current[i].data);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -560,13 +560,13 @@ dlz_newversion(const char *zone, void *dbdata, void **versionp) {
|
|||
"started for zone %s",
|
||||
zone);
|
||||
}
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
state->transaction_started = true;
|
||||
*versionp = (void *)&state->transaction_started;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -647,7 +647,7 @@ dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata) {
|
|||
"writeable_zone method "
|
||||
"available");
|
||||
}
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = state->writeable_zone(view, dlzdb, state->zone_name);
|
||||
|
|
@ -658,7 +658,7 @@ dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata) {
|
|||
"configure zone %s",
|
||||
state->zone_name);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (state->log != NULL) {
|
||||
|
|
@ -667,7 +667,7 @@ dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata) {
|
|||
"zone %s",
|
||||
state->zone_name);
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -692,7 +692,7 @@ dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
|
|||
"of name=%s by %s",
|
||||
name, signer);
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
if (state->log != NULL) {
|
||||
state->log(ISC_LOG_INFO,
|
||||
|
|
@ -700,7 +700,7 @@ dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
|
|||
"name=%s by %s",
|
||||
name, signer);
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -713,7 +713,7 @@ modrdataset(struct dlz_example_data *state, const char *name,
|
|||
|
||||
buf = strdup(rdatastr);
|
||||
if (buf == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -757,11 +757,11 @@ modrdataset(struct dlz_example_data *state, const char *name,
|
|||
result = add_name(state, list, name, type, strtoul(ttlstr, NULL, 10),
|
||||
data);
|
||||
free(buf);
|
||||
return (result);
|
||||
return result;
|
||||
|
||||
error:
|
||||
free(buf);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -770,7 +770,7 @@ dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
|
||||
|
||||
if (version != (void *)&state->transaction_started) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (state->log != NULL) {
|
||||
|
|
@ -778,7 +778,7 @@ dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
name, rdatastr);
|
||||
}
|
||||
|
||||
return (modrdataset(state, name, rdatastr, &state->adds[0]));
|
||||
return modrdataset(state, name, rdatastr, &state->adds[0]);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -787,7 +787,7 @@ dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
|
||||
|
||||
if (version != (void *)&state->transaction_started) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (state->log != NULL) {
|
||||
|
|
@ -797,7 +797,7 @@ dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
name, rdatastr);
|
||||
}
|
||||
|
||||
return (modrdataset(state, name, rdatastr, &state->deletes[0]));
|
||||
return modrdataset(state, name, rdatastr, &state->deletes[0]);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -806,7 +806,7 @@ dlz_delrdataset(const char *name, const char *type, void *dbdata,
|
|||
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
|
||||
|
||||
if (version != (void *)&state->transaction_started) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (state->log != NULL) {
|
||||
|
|
@ -816,5 +816,5 @@ dlz_delrdataset(const char *name, const char *type, void *dbdata,
|
|||
name, type);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,14 +92,14 @@ bdbhpt_strrev(char *str) {
|
|||
char *p1, *p2;
|
||||
|
||||
if (!str || !*str) {
|
||||
return (str);
|
||||
return str;
|
||||
}
|
||||
for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2) {
|
||||
*p1 ^= *p2;
|
||||
*p2 ^= *p1;
|
||||
*p1 ^= *p2;
|
||||
}
|
||||
return (str);
|
||||
return str;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -144,11 +144,11 @@ bdbhpt_parse_data(log_t *log, char *in, bdbhpt_parsed_data_t *pd) {
|
|||
tmp = strchr(tmp, ' ');
|
||||
/* verify we found a space */
|
||||
if (tmp == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
/* make sure it is safe to increment pointer */
|
||||
if (++tmp > lastchar) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* save pointer to host */
|
||||
|
|
@ -158,13 +158,13 @@ bdbhpt_parse_data(log_t *log, char *in, bdbhpt_parsed_data_t *pd) {
|
|||
tmp = strchr(tmp, ' ');
|
||||
/* verify we found a space */
|
||||
if (tmp == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
/* change the space to a null (string terminator) */
|
||||
tmp[0] = '\0';
|
||||
/* make sure it is safe to increment pointer */
|
||||
if (++tmp > lastchar) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* save pointer to ttl string */
|
||||
|
|
@ -174,13 +174,13 @@ bdbhpt_parse_data(log_t *log, char *in, bdbhpt_parsed_data_t *pd) {
|
|||
tmp = strchr(tmp, ' ');
|
||||
/* verify we found a space */
|
||||
if (tmp == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
/* change the space to a null (string terminator) */
|
||||
tmp[0] = '\0';
|
||||
/* make sure it is safe to increment pointer */
|
||||
if (++tmp > lastchar) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* save pointer to dns type */
|
||||
|
|
@ -190,13 +190,13 @@ bdbhpt_parse_data(log_t *log, char *in, bdbhpt_parsed_data_t *pd) {
|
|||
tmp = strchr(tmp, ' ');
|
||||
/* verify we found a space */
|
||||
if (tmp == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
/* change the space to a null (string terminator) */
|
||||
tmp[0] = '\0';
|
||||
/* make sure it is safe to increment pointer */
|
||||
if (++tmp > lastchar) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* save pointer to remainder of DNS data */
|
||||
|
|
@ -207,11 +207,11 @@ bdbhpt_parse_data(log_t *log, char *in, bdbhpt_parsed_data_t *pd) {
|
|||
if (*endp != '\0' || pd->ttl < 0) {
|
||||
log(ISC_LOG_ERROR, "bdbhpt_dynamic: "
|
||||
"ttl must be a positive number");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* if we get this far everything should have worked. */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -230,7 +230,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
result = dlz_findzonedb(dbdata, name);
|
||||
#endif /* if DLZ_DLOPEN_VERSION >= 3 */
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
memset(&key, 0, sizeof(DBT));
|
||||
|
|
@ -273,7 +273,7 @@ xfr_cleanup:
|
|||
free(data.data);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -323,7 +323,7 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
|
||||
xfr_key.data = tmp_zone = strdup(zone);
|
||||
if (xfr_key.data == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
xfr_key.size = strlen(xfr_key.data);
|
||||
|
|
@ -426,7 +426,7 @@ allnodes_cleanup:
|
|||
dns_cursor->c_close(dns_cursor);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -484,7 +484,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
key.data = strdup(name);
|
||||
|
||||
if (key.data == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -516,7 +516,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
free(data.data);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -559,7 +559,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
key.data = keyStr = malloc((key.size + 1) * sizeof(char));
|
||||
|
||||
if (keyStr == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
strcpy(keyStr, zone);
|
||||
|
|
@ -608,7 +608,7 @@ lookup_cleanup:
|
|||
free(tmp);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -625,7 +625,7 @@ bdbhpt_opendb(log_t *log, DB_ENV *db_env, DBTYPE db_type, DB **db,
|
|||
"bdbhpt_dynamic: could not initialize %s database. "
|
||||
"BerkeleyDB error: %s",
|
||||
db_name, db_strerror(result));
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* set database flags. */
|
||||
|
|
@ -634,7 +634,7 @@ bdbhpt_opendb(log_t *log, DB_ENV *db_env, DBTYPE db_type, DB **db,
|
|||
"bdbhpt_dynamic: could not set flags for %s database. "
|
||||
"BerkeleyDB error: %s",
|
||||
db_name, db_strerror(result));
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* open the database. */
|
||||
|
|
@ -645,10 +645,10 @@ bdbhpt_opendb(log_t *log, DB_ENV *db_env, DBTYPE db_type, DB **db,
|
|||
"bdbhpt_dynamic: could not open %s database in %s. "
|
||||
"BerkeleyDB error: %s",
|
||||
db_name, db_file, db_strerror(result));
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -670,7 +670,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
/* Allocate memory for our db structures and helper functions */
|
||||
db = calloc(1, sizeof(struct bdbhpt_instance));
|
||||
if (db == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/* Fill in the helper functions */
|
||||
|
|
@ -686,7 +686,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
"bdbhpt_dynamic: please supply 3 command line args. "
|
||||
"You supplied: %s",
|
||||
argc);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
switch ((char)*argv[1]) {
|
||||
|
|
@ -726,7 +726,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
"operating mode must be set to P or C or T. "
|
||||
"You specified '%s'",
|
||||
argv[1]);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -788,11 +788,11 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
|
||||
db->log(ISC_LOG_INFO, "bdbhpt_dynamic: version %s, started",
|
||||
dlz_bdbhpt_dynamic_version);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
init_cleanup:
|
||||
bdbhpt_cleanup(db);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -814,7 +814,7 @@ dlz_destroy(void *dbdata) {
|
|||
int
|
||||
dlz_version(unsigned int *flags) {
|
||||
UNUSED(flags);
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -95,10 +95,10 @@ build_querylist(const char *query_str, char **zone, char **record,
|
|||
if (query_str == NULL || strlen(query_str) < 1) {
|
||||
if ((flags & REQUIRE_QUERY) == 0) {
|
||||
/* we don't need it were ok. */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
/* we did need it, PROBLEM!!! */
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ build_querylist(const char *query_str, char **zone, char **record,
|
|||
tql = calloc(1, sizeof(query_list_t));
|
||||
/* couldn't allocate memory. Problem!! */
|
||||
if (tql == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/* initialize the query segment list */
|
||||
|
|
@ -236,7 +236,7 @@ build_querylist(const char *query_str, char **zone, char **record,
|
|||
*querylist = (query_list_t *)tql;
|
||||
|
||||
/* return success */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
/* get rid of temp_str */
|
||||
|
|
@ -247,7 +247,7 @@ cleanup:
|
|||
flag_fail:
|
||||
/* get rid of what was build of the query list */
|
||||
destroy_querylist(&tql);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -279,7 +279,7 @@ build_querystring(query_list_t *querylist) {
|
|||
|
||||
qs = malloc(length + 1);
|
||||
if (qs == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*qs = '\0';
|
||||
|
|
@ -297,7 +297,7 @@ build_querystring(query_list_t *querylist) {
|
|||
tseg = DLZ_LIST_NEXT(tseg, link);
|
||||
}
|
||||
|
||||
return (qs);
|
||||
return qs;
|
||||
}
|
||||
|
||||
/*% constructs a dbinstance (DBI) */
|
||||
|
|
@ -317,7 +317,7 @@ build_dbinstance(const char *allnodes_str, const char *allowxfr_str,
|
|||
log(ISC_LOG_ERROR, "Could not allocate memory for "
|
||||
"database instance object.");
|
||||
}
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
memset(db, 0, sizeof(dbinstance_t));
|
||||
db->dbconn = NULL;
|
||||
|
|
@ -423,13 +423,13 @@ build_dbinstance(const char *allnodes_str, const char *allowxfr_str,
|
|||
*dbi = (dbinstance_t *)db;
|
||||
|
||||
/* return success */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
/* destroy whatever was build of the db instance */
|
||||
destroy_dbinstance(db);
|
||||
/* return failure */
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -457,19 +457,19 @@ get_parameter_value(const char *input, const char *key) {
|
|||
int i;
|
||||
|
||||
if (key == NULL || input == NULL || *input == '\0') {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
keylen = strlen(key);
|
||||
|
||||
if (keylen < 1) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
keystart = strstr(input, key);
|
||||
|
||||
if (keystart == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < 255; i++) {
|
||||
|
|
@ -480,5 +480,5 @@ get_parameter_value(const char *input, const char *key) {
|
|||
}
|
||||
}
|
||||
|
||||
return (strdup(value));
|
||||
return strdup(value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ dir_open(dir_t *dir, const char *dirname) {
|
|||
isc_result_t result = ISC_R_SUCCESS;
|
||||
|
||||
if (strlen(dirname) + 3 > sizeof(dir->dirname)) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
strcpy(dir->dirname, dirname);
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ dir_open(dir_t *dir, const char *dirname) {
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -85,17 +85,17 @@ dir_read(dir_t *dir) {
|
|||
|
||||
entry = readdir(dir->handle);
|
||||
if (entry == NULL) {
|
||||
return (ISC_R_NOMORE);
|
||||
return ISC_R_NOMORE;
|
||||
}
|
||||
|
||||
if (sizeof(dir->entry.name) <= strlen(entry->d_name)) {
|
||||
return (ISC_R_UNEXPECTED);
|
||||
return ISC_R_UNEXPECTED;
|
||||
}
|
||||
|
||||
strcpy(dir->entry.name, entry->d_name);
|
||||
|
||||
dir->entry.length = strlen(entry->d_name);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -114,5 +114,5 @@ isc_result_t
|
|||
dir_reset(dir_t *dir) {
|
||||
rewinddir(dir->handle);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,15 +89,15 @@ is_safe(const char *input) {
|
|||
if (input[i] == '.') {
|
||||
/* '.' is not allowed as first char */
|
||||
if (i == 0) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
/* '..', two dots together is not allowed. */
|
||||
if (input[i - 1] == '.') {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
/* '.' is not allowed as last char */
|
||||
if (i == len - 1) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
/* only 1 dot in ok location, continue at next char */
|
||||
continue;
|
||||
|
|
@ -140,10 +140,10 @@ is_safe(const char *input) {
|
|||
* if we reach this point we have encountered a
|
||||
* disallowed char!
|
||||
*/
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
/* everything ok. */
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -154,7 +154,7 @@ create_path_helper(char *out, const char *in, config_data_t *cd) {
|
|||
|
||||
tmpString = strdup(in);
|
||||
if (tmpString == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -204,7 +204,7 @@ create_path_helper(char *out, const char *in, config_data_t *cd) {
|
|||
}
|
||||
|
||||
free(tmpString);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -229,17 +229,17 @@ create_path(const char *zone, const char *host, const char *client,
|
|||
|
||||
/* if the requested zone is "unsafe", return error */
|
||||
if (!isroot && !is_safe(zone)) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* if host was passed, verify that it is safe */
|
||||
if (host != NULL && !is_safe(host)) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* if client was passed, verify that it is safe */
|
||||
if (client != NULL && !is_safe(client)) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* Determine how much memory the split up string will require */
|
||||
|
|
@ -338,7 +338,7 @@ cleanup_mem:
|
|||
free(tmpPath);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -477,7 +477,7 @@ process_dir(dir_t *dir, void *passback, config_data_t *cd, dlist_t *dir_list,
|
|||
if (dir_list != NULL) {
|
||||
direntry = malloc(sizeof(dir_entry_t));
|
||||
if (direntry == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
strcpy(direntry->dirpath, tmp);
|
||||
DLZ_LINK_INIT(direntry, link);
|
||||
|
|
@ -507,7 +507,7 @@ process_dir(dir_t *dir, void *passback, config_data_t *cd, dlist_t *dir_list,
|
|||
"Filesystem driver: "
|
||||
"%s could not be parsed properly",
|
||||
tmp);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* replace separator char with NULL to split string */
|
||||
|
|
@ -521,7 +521,7 @@ process_dir(dir_t *dir, void *passback, config_data_t *cd, dlist_t *dir_list,
|
|||
"Filesystem driver: "
|
||||
"%s could not be parsed properly",
|
||||
tmp);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* replace separator char with NULL to split string */
|
||||
|
|
@ -557,11 +557,11 @@ process_dir(dir_t *dir, void *passback, config_data_t *cd, dlist_t *dir_list,
|
|||
|
||||
/* if error, return error right away */
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
} /* end of while loop */
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -578,7 +578,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
cd = (config_data_t *)dbdata;
|
||||
|
||||
if (create_path(name, NULL, client, cd, &path) != ISC_R_SUCCESS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
if (stat(path, &sb) != 0) {
|
||||
|
|
@ -595,7 +595,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
|
||||
complete_AXFR:
|
||||
free(path);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -706,7 +706,7 @@ complete_allnds:
|
|||
free(basepath);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#if DLZ_DLOPEN_VERSION < 3
|
||||
|
|
@ -730,7 +730,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
#endif /* if DLZ_DLOPEN_VERSION >= 3 */
|
||||
|
||||
if (create_path(name, NULL, NULL, cd, &path) != ISC_R_SUCCESS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
cd->log(ISC_LOG_DEBUG(1),
|
||||
|
|
@ -751,7 +751,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
complete_FZ:
|
||||
|
||||
free(path);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#if DLZ_DLOPEN_VERSION == 1
|
||||
|
|
@ -788,7 +788,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
}
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/* remove path separator at end of path so stat works properly */
|
||||
|
|
@ -828,7 +828,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
complete_lkup:
|
||||
|
||||
free(path);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -931,7 +931,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
*dbdata = cd;
|
||||
|
||||
/* return success */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
/* handle no memory error */
|
||||
no_mem:
|
||||
|
|
@ -950,7 +950,7 @@ free_cd:
|
|||
}
|
||||
|
||||
/* return error */
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -985,7 +985,7 @@ dlz_destroy(void *dbdata) {
|
|||
int
|
||||
dlz_version(unsigned int *flags) {
|
||||
UNUSED(flags);
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ cleanup:
|
|||
ldap_free_urldesc(ldap_url);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*% Connects / reconnects to LDAP server */
|
||||
|
|
@ -190,7 +190,7 @@ dlz_ldap_connect(ldap_instance_t *dbi, dbinstance_t *dbc) {
|
|||
/* initialize. */
|
||||
dbc->dbconn = ldap_init(dbi->hosts, LDAP_PORT);
|
||||
if (dbc->dbconn == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
/* set protocol version. */
|
||||
|
|
@ -210,7 +210,7 @@ dlz_ldap_connect(ldap_instance_t *dbi, dbinstance_t *dbc) {
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ cleanup:
|
|||
dbc->dbconn = NULL;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -275,7 +275,7 @@ dlz_ldap_find_avail_conn(ldap_instance_t *ldap) {
|
|||
while (count < dbc_search_limit) {
|
||||
/* try to lock on the mutex */
|
||||
if (dlz_mutex_trylock(&dbi->lock) == 0) {
|
||||
return (dbi); /* success, return the DBI for use. */
|
||||
return dbi; /* success, return the DBI for use. */
|
||||
}
|
||||
/* not successful, keep trying */
|
||||
dbi = DLZ_LIST_NEXT(dbi, link);
|
||||
|
|
@ -291,7 +291,7 @@ dlz_ldap_find_avail_conn(ldap_instance_t *ldap) {
|
|||
"LDAP driver unable to find available connection "
|
||||
"after searching %d times",
|
||||
count);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -314,7 +314,7 @@ dlz_ldap_process_results(ldap_instance_t *db, LDAP *dbc, LDAPMessage *msg,
|
|||
entry = ldap_first_entry(dbc, msg);
|
||||
if (entry == NULL) {
|
||||
db->log(ISC_LOG_INFO, "LDAP no entries to process.");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* loop through all entries returned */
|
||||
|
|
@ -507,7 +507,7 @@ cleanup:
|
|||
free(data);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -541,7 +541,7 @@ dlz_ldap_get_results(const char *zone, const char *record, const char *client,
|
|||
|
||||
/* if DBI is null, can't do anything else */
|
||||
if (dbi == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* set fields */
|
||||
|
|
@ -802,7 +802,7 @@ cleanup:
|
|||
}
|
||||
|
||||
/* return result */
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -819,25 +819,25 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
result = dlz_findzonedb(dbdata, name, NULL, NULL);
|
||||
#endif /* if DLZ_DLOPEN_VERSION < 3 */
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* get all the zone data */
|
||||
result = dlz_ldap_get_results(name, NULL, client, ALLOWXFR, dbdata,
|
||||
NULL);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
||||
return (dlz_ldap_get_results(zone, NULL, NULL, ALLNODES, dbdata,
|
||||
allnodes));
|
||||
return dlz_ldap_get_results(zone, NULL, NULL, ALLNODES, dbdata,
|
||||
allnodes);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dlz_authority(const char *zone, void *dbdata, dns_sdlzlookup_t *lookup) {
|
||||
return (dlz_ldap_get_results(zone, NULL, NULL, AUTHORITY, dbdata,
|
||||
lookup));
|
||||
return dlz_ldap_get_results(zone, NULL, NULL, AUTHORITY, dbdata,
|
||||
lookup);
|
||||
}
|
||||
|
||||
#if DLZ_DLOPEN_VERSION < 3
|
||||
|
|
@ -853,7 +853,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
UNUSED(methods);
|
||||
UNUSED(clientinfo);
|
||||
#endif /* if DLZ_DLOPEN_VERSION >= 3 */
|
||||
return (dlz_ldap_get_results(name, NULL, NULL, FINDZONE, dbdata, NULL));
|
||||
return dlz_ldap_get_results(name, NULL, NULL, FINDZONE, dbdata, NULL);
|
||||
}
|
||||
|
||||
#if DLZ_DLOPEN_VERSION == 1
|
||||
|
|
@ -881,7 +881,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
result = dlz_ldap_get_results(zone, name, NULL, LOOKUP, dbdata,
|
||||
lookup);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -900,7 +900,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
/* allocate memory for LDAP instance */
|
||||
ldap = calloc(1, sizeof(ldap_instance_t));
|
||||
if (ldap == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
memset(ldap, 0, sizeof(ldap_instance_t));
|
||||
|
||||
|
|
@ -1131,12 +1131,12 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
/* set dbdata to the ldap_instance we created. */
|
||||
*dbdata = ldap;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
dlz_destroy(ldap);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1167,7 +1167,7 @@ dlz_destroy(void *dbdata) {
|
|||
int
|
||||
dlz_version(unsigned int *flags) {
|
||||
*flags |= DNS_SDLZFLAG_RELATIVERDATA | DNS_SDLZFLAG_THREADSAFE;
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ mysql_find_avail_conn(mysql_instance_t *mysql) {
|
|||
while (count < dbc_search_limit) {
|
||||
/* try to lock on the mutex */
|
||||
if (dlz_mutex_trylock(&dbi->lock) == 0) {
|
||||
return (dbi); /* success, return the DBI for use. */
|
||||
return dbi; /* success, return the DBI for use. */
|
||||
}
|
||||
/* not successful, keep trying */
|
||||
dbi = DLZ_LIST_NEXT(dbi, link);
|
||||
|
|
@ -168,7 +168,7 @@ mysql_find_avail_conn(mysql_instance_t *mysql) {
|
|||
"MySQL module unable to find available connection "
|
||||
"after searching %d times",
|
||||
count);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -184,18 +184,18 @@ mysqldrv_escape_string(MYSQL *mysql, const char *instr) {
|
|||
unsigned int len;
|
||||
|
||||
if (instr == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
len = strlen(instr);
|
||||
outstr = malloc((2 * len * sizeof(char)) + 1);
|
||||
if (outstr == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mysql_real_escape_string(mysql, outstr, instr, len);
|
||||
|
||||
return (outstr);
|
||||
return outstr;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -222,7 +222,7 @@ mysql_get_resultset(const char *zone, const char *record, const char *client,
|
|||
dbi = mysql_find_avail_conn(db);
|
||||
|
||||
if (dbi == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* what type of query are we going to run? */
|
||||
|
|
@ -404,7 +404,7 @@ cleanup:
|
|||
free(querystring);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -456,7 +456,7 @@ mysql_process_rs(mysql_instance_t *db, dns_sdlzlookup_t *lookup,
|
|||
db->log(ISC_LOG_ERROR, "MySQL module ttl must "
|
||||
"be "
|
||||
"a positive number");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = db->putrr(lookup, safeGet(row[1]), ttl,
|
||||
|
|
@ -483,7 +483,7 @@ mysql_process_rs(mysql_instance_t *db, dns_sdlzlookup_t *lookup,
|
|||
"memory for temporary "
|
||||
"string");
|
||||
mysql_free_result(rs);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
strcpy(tmpString, safeGet(row[2]));
|
||||
|
|
@ -498,7 +498,7 @@ mysql_process_rs(mysql_instance_t *db, dns_sdlzlookup_t *lookup,
|
|||
"be "
|
||||
"a positive number");
|
||||
free(tmpString);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = db->putrr(lookup, safeGet(row[1]), ttl,
|
||||
|
|
@ -510,14 +510,14 @@ mysql_process_rs(mysql_instance_t *db, dns_sdlzlookup_t *lookup,
|
|||
mysql_free_result(rs);
|
||||
db->log(ISC_LOG_ERROR, "putrr returned error: %d",
|
||||
result);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
row = mysql_fetch_row(rs);
|
||||
}
|
||||
|
||||
mysql_free_result(rs);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -545,7 +545,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
db->log(ISC_LOG_ERROR, "MySQL module unable to return "
|
||||
"result set for findzone query");
|
||||
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -555,10 +555,10 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
mysql_free_result(rs);
|
||||
if (rows > 0) {
|
||||
mysql_get_resultset(name, NULL, NULL, COUNTZONE, dbdata, NULL);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/*% Determine if the client is allowed to perform a zone transfer */
|
||||
|
|
@ -572,7 +572,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
/* first check if the zone is supported by the database. */
|
||||
result = dlz_findzonedb(dbdata, name, NULL, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -583,7 +583,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
*/
|
||||
result = mysql_get_resultset(name, NULL, client, ALLOWXFR, dbdata, &rs);
|
||||
if (result == ISC_R_NOTIMPLEMENTED) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result != ISC_R_SUCCESS || rs == NULL) {
|
||||
|
|
@ -592,7 +592,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
}
|
||||
db->log(ISC_LOG_ERROR, "MySQL module unable to return "
|
||||
"result set for allow xfr query");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -602,10 +602,10 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
rows = mysql_num_rows(rs);
|
||||
mysql_free_result(rs);
|
||||
if (rows > 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (ISC_R_NOPERM);
|
||||
return ISC_R_NOPERM;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -627,7 +627,7 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
|
||||
result = mysql_get_resultset(zone, NULL, NULL, ALLNODES, dbdata, &rs);
|
||||
if (result == ISC_R_NOTIMPLEMENTED) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* if we didn't get a result set, log an err msg. */
|
||||
|
|
@ -710,7 +710,7 @@ cleanup:
|
|||
mysql_free_result(rs);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -725,7 +725,7 @@ dlz_authority(const char *zone, void *dbdata, dns_sdlzlookup_t *lookup) {
|
|||
|
||||
result = mysql_get_resultset(zone, NULL, NULL, AUTHORITY, dbdata, &rs);
|
||||
if (result == ISC_R_NOTIMPLEMENTED) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
@ -734,14 +734,14 @@ dlz_authority(const char *zone, void *dbdata, dns_sdlzlookup_t *lookup) {
|
|||
}
|
||||
db->log(ISC_LOG_ERROR, "MySQL module unable to return "
|
||||
"result set for authority query");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
* lookup and authority result sets are processed in the same
|
||||
* manner: mysql_process_rs does the job for both functions.
|
||||
*/
|
||||
return (mysql_process_rs(db, lookup, rs));
|
||||
return mysql_process_rs(db, lookup, rs);
|
||||
}
|
||||
|
||||
/*% If zone is supported, lookup up a (or multiple) record(s) in it */
|
||||
|
|
@ -765,14 +765,14 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
}
|
||||
db->log(ISC_LOG_ERROR, "MySQL module unable to return "
|
||||
"result set for lookup query");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
* lookup and authority result sets are processed in the same
|
||||
* manner: mysql_process_rs does the job for both functions.
|
||||
*/
|
||||
return (mysql_process_rs(db, lookup, rs));
|
||||
return mysql_process_rs(db, lookup, rs);
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -796,7 +796,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
/* allocate memory for MySQL instance */
|
||||
mysql = calloc(1, sizeof(mysql_instance_t));
|
||||
if (mysql == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
memset(mysql, 0, sizeof(mysql_instance_t));
|
||||
|
||||
|
|
@ -814,14 +814,14 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
if (argc < 4) {
|
||||
mysql->log(ISC_LOG_ERROR, "MySQL module requires "
|
||||
"at least 4 command line args.");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* no more than 8 arg's should be passed to the module */
|
||||
if (argc > 8) {
|
||||
mysql->log(ISC_LOG_ERROR, "MySQL module cannot accept "
|
||||
"more than 7 command line args.");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* get db name - required */
|
||||
|
|
@ -1004,12 +1004,12 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
|
||||
*dbdata = mysql;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
dlz_destroy(mysql);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -1048,7 +1048,7 @@ int
|
|||
dlz_version(unsigned int *flags) {
|
||||
*flags |= (DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA |
|
||||
DNS_SDLZFLAG_THREADSAFE);
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ db_connect(mysql_data_t *state, mysql_instance_t *dbi) {
|
|||
mysql_thread_init();
|
||||
|
||||
if (dbi->connected) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (state->log != NULL) {
|
||||
|
|
@ -278,11 +278,11 @@ db_connect(mysql_data_t *state, mysql_instance_t *dbi) {
|
|||
}
|
||||
|
||||
dlz_mutex_unlock(&dbi->mutex);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
dbi->connected = 1;
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static mysql_instance_t *
|
||||
|
|
@ -303,9 +303,9 @@ get_dbi(mysql_data_t *state) {
|
|||
state->log(ISC_LOG_ERROR,
|
||||
"%s: No available connections", modname);
|
||||
}
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
return (&state->db[i]);
|
||||
return &state->db[i];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -317,7 +317,7 @@ sanitize(mysql_instance_t *dbi, const char *original) {
|
|||
char *s;
|
||||
|
||||
if (original == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s = (char *)malloc((strlen(original) * 2) + 1);
|
||||
|
|
@ -328,7 +328,7 @@ sanitize(mysql_instance_t *dbi, const char *original) {
|
|||
strlen(original));
|
||||
}
|
||||
|
||||
return (s);
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -341,7 +341,7 @@ additem(mysql_arglist_t *arglist, char **s, size_t *len) {
|
|||
|
||||
item = malloc(sizeof(*item));
|
||||
if (item == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
DLZ_LINK_INIT(item, link);
|
||||
|
|
@ -350,7 +350,7 @@ additem(mysql_arglist_t *arglist, char **s, size_t *len) {
|
|||
DLZ_LIST_APPEND(*arglist, item, link);
|
||||
*s = NULL;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -379,7 +379,7 @@ build_query(mysql_data_t *state, mysql_instance_t *dbi, const char *command,
|
|||
if (dbi == NULL) {
|
||||
dbi = get_dbi(state);
|
||||
if (dbi == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
localdbi = true;
|
||||
}
|
||||
|
|
@ -480,22 +480,22 @@ fail:
|
|||
dlz_mutex_unlock(&dbi->mutex);
|
||||
}
|
||||
|
||||
return (query);
|
||||
return query;
|
||||
}
|
||||
|
||||
/* Does this name end in a dot? */
|
||||
static bool
|
||||
isrelative(const char *s) {
|
||||
if (s == NULL || s[strlen(s) - 1] == '.') {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Return a dot if 's' doesn't already end with one */
|
||||
static const char *
|
||||
dot(const char *s) {
|
||||
return (isrelative(s) ? "." : "");
|
||||
return isrelative(s) ? "." : "";
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -532,7 +532,7 @@ relname(const char *name, const char *zone) {
|
|||
|
||||
new = (char *)malloc(strlen(name) + 1);
|
||||
if (new == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nlen = strlen(name);
|
||||
|
|
@ -540,10 +540,10 @@ relname(const char *name, const char *zone) {
|
|||
|
||||
if (nlen < zlen) {
|
||||
strcpy(new, name);
|
||||
return (new);
|
||||
return new;
|
||||
} else if (nlen == zlen || strcasecmp(name, zone) == 0) {
|
||||
strcpy(new, "@");
|
||||
return (new);
|
||||
return new;
|
||||
}
|
||||
|
||||
p = name + nlen - zlen;
|
||||
|
|
@ -551,12 +551,12 @@ relname(const char *name, const char *zone) {
|
|||
(zone[zlen - 1] != '.' || strncasecmp(p, zone, zlen - 1) != 0))
|
||||
{
|
||||
strcpy(new, name);
|
||||
return (new);
|
||||
return new;
|
||||
}
|
||||
|
||||
strncpy(new, name, nlen - zlen);
|
||||
new[nlen - zlen - 1] = '\0';
|
||||
return (new);
|
||||
return new;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -577,7 +577,7 @@ validate_txn(mysql_data_t *state, mysql_transaction_t *txn) {
|
|||
state->log(ISC_LOG_ERROR, "%s: invalid txn %x", modname, txn);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -586,7 +586,7 @@ db_execute(mysql_data_t *state, mysql_instance_t *dbi, const char *query) {
|
|||
|
||||
/* Make sure this instance is connected. */
|
||||
if (!db_connect(state, dbi)) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
ret = mysql_real_query(dbi->sock, query, strlen(query));
|
||||
|
|
@ -595,7 +595,7 @@ db_execute(mysql_data_t *state, mysql_instance_t *dbi, const char *query) {
|
|||
state->log(ISC_LOG_ERROR, "%s: query '%s' failed: %s",
|
||||
modname, query, mysql_error(dbi->sock));
|
||||
}
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (state->debug && state->log != NULL) {
|
||||
|
|
@ -603,7 +603,7 @@ db_execute(mysql_data_t *state, mysql_instance_t *dbi, const char *query) {
|
|||
query);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static MYSQL_RES *
|
||||
|
|
@ -613,14 +613,14 @@ db_query(mysql_data_t *state, mysql_instance_t *dbi, const char *query) {
|
|||
MYSQL_RES *res = NULL;
|
||||
|
||||
if (query == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Get a DB instance if needed */
|
||||
if (dbi == NULL) {
|
||||
dbi = get_dbi(state);
|
||||
if (dbi == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
localdbi = true;
|
||||
}
|
||||
|
|
@ -654,7 +654,7 @@ fail:
|
|||
if (dbi != NULL && localdbi) {
|
||||
dlz_mutex_unlock(&dbi->mutex);
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -676,7 +676,7 @@ make_notify(const char *zone, int *packetlen) {
|
|||
unsigned char *packet = (unsigned char *)malloc(strlen(zone) + 18);
|
||||
|
||||
if (packet == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*packetlen = strlen(zone) + 18;
|
||||
|
|
@ -722,7 +722,7 @@ make_notify(const char *zone, int *packetlen) {
|
|||
packet[j + 3] = htons(i) & 0xff;
|
||||
packet[j + 4] = htons(i) >> 8;
|
||||
|
||||
return (packet);
|
||||
return packet;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -851,7 +851,7 @@ makerecord(mysql_data_t *state, const char *name, const char *rdatastr) {
|
|||
"%s: makerecord - unable to malloc",
|
||||
modname);
|
||||
}
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buf = strdup(rdatastr);
|
||||
|
|
@ -862,7 +862,7 @@ makerecord(mysql_data_t *state, const char *name, const char *rdatastr) {
|
|||
modname);
|
||||
}
|
||||
free(new_record);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -903,12 +903,12 @@ makerecord(mysql_data_t *state, const char *name, const char *rdatastr) {
|
|||
sprintf(new_record->ttl, "%d", ttlvalue);
|
||||
|
||||
free(buf);
|
||||
return (new_record);
|
||||
return new_record;
|
||||
|
||||
error:
|
||||
free(buf);
|
||||
free(new_record);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -941,7 +941,7 @@ int
|
|||
dlz_version(unsigned int *flags) {
|
||||
UNUSED(flags);
|
||||
*flags |= DNS_SDLZFLAG_THREADSAFE;
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -959,7 +959,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
|
||||
state = calloc(1, sizeof(mysql_data_t));
|
||||
if (state == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
dlz_mutex_init(&state->tx_mutex, NULL);
|
||||
|
|
@ -984,7 +984,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
modname);
|
||||
}
|
||||
dlz_destroy(state);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
state->db_name = strdup(argv[1]);
|
||||
|
|
@ -1033,7 +1033,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
|
||||
*dbdata = state;
|
||||
dlz_mutex_unlock(&state->tx_mutex);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
free(state->db_name);
|
||||
|
|
@ -1042,7 +1042,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
free(state->db_pass);
|
||||
dlz_mutex_destroy(&state->tx_mutex);
|
||||
free(state);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1088,12 +1088,12 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
query = build_query(state, NULL, Q_FINDZONE, name);
|
||||
|
||||
if (query == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
res = db_query(state, NULL, query);
|
||||
if (res == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (mysql_num_rows(res) == 0) {
|
||||
|
|
@ -1101,7 +1101,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
}
|
||||
|
||||
mysql_free_result(res);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1128,7 +1128,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
state->log(ISC_LOG_ERROR, "%s: dlz_lookup - no putrr",
|
||||
modname);
|
||||
}
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
/* Are we okay to try to find the txn version? */
|
||||
|
|
@ -1147,13 +1147,13 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
if (strcmp(name, "@") == 0) {
|
||||
real_name = (char *)malloc(strlen(zone) + 1);
|
||||
if (real_name == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
strcpy(real_name, zone);
|
||||
} else {
|
||||
real_name = (char *)malloc(strlen(name) + 1);
|
||||
if (real_name == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
strcpy(real_name, name);
|
||||
}
|
||||
|
|
@ -1166,7 +1166,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
query = build_query(state, dbi, Q_GETSOA, zone);
|
||||
if (query == NULL) {
|
||||
free(real_name);
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
res = db_query(state, dbi, query);
|
||||
|
|
@ -1174,7 +1174,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
|
||||
if (res == NULL) {
|
||||
free(real_name);
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
while ((row = mysql_fetch_row(res)) != NULL) {
|
||||
|
|
@ -1194,7 +1194,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
free(real_name);
|
||||
mysql_free_result(res);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1213,7 +1213,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
|
||||
if (res == NULL) {
|
||||
free(real_name);
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
while ((row = mysql_fetch_row(res)) != NULL) {
|
||||
|
|
@ -1223,7 +1223,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
free(real_name);
|
||||
mysql_free_result(res);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
found = true;
|
||||
|
|
@ -1238,10 +1238,10 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
free(real_name);
|
||||
|
||||
if (!found) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1257,7 +1257,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
}
|
||||
|
||||
/* Just say yes for all our zones */
|
||||
return (dlz_findzonedb(dbdata, name, NULL, NULL));
|
||||
return dlz_findzonedb(dbdata, name, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1278,7 +1278,7 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
}
|
||||
|
||||
if (state->putnamedrr == NULL) {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1286,13 +1286,13 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
*/
|
||||
query = build_query(state, NULL, Q_GETALL, zone);
|
||||
if (query == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
res = db_query(state, NULL, query);
|
||||
free(query);
|
||||
if (res == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
while ((row = mysql_fetch_row(res)) != NULL) {
|
||||
|
|
@ -1309,7 +1309,7 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
}
|
||||
|
||||
mysql_free_result(res);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1330,18 +1330,18 @@ dlz_newversion(const char *zone, void *dbdata, void **versionp) {
|
|||
*/
|
||||
query = build_query(state, NULL, Q_WRITEABLE, zone);
|
||||
if (query == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
res = db_query(state, NULL, query);
|
||||
free(query);
|
||||
if (res == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if ((row = mysql_fetch_row(res)) == NULL) {
|
||||
mysql_free_result(res);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
strcpy(zone_id, row[0]);
|
||||
|
|
@ -1360,7 +1360,7 @@ dlz_newversion(const char *zone, void *dbdata, void **versionp) {
|
|||
modname, zone);
|
||||
}
|
||||
dlz_mutex_unlock(&state->tx_mutex);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1423,7 +1423,7 @@ cleanup:
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1585,7 +1585,7 @@ dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata)
|
|||
"%s: no writeable_zone method available",
|
||||
modname);
|
||||
}
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1593,7 +1593,7 @@ dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata)
|
|||
*/
|
||||
res = db_query(state, NULL, Q_GETZONES);
|
||||
if (res == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
|
|
@ -1613,7 +1613,7 @@ dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata)
|
|||
modname, row[0]);
|
||||
}
|
||||
mysql_free_result(res);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
|
@ -1623,7 +1623,7 @@ dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata)
|
|||
state->log(ISC_LOG_INFO, "%s: configured %d zones", modname,
|
||||
count);
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1645,7 +1645,7 @@ dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
|
|||
state->log(ISC_LOG_INFO, "%s: allowing update of %s by key %s",
|
||||
modname, name, signer);
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -1658,12 +1658,12 @@ dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
isc_result_t result;
|
||||
|
||||
if (txn == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
new_name = relname(name, txn->zone);
|
||||
if (new_name == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
if (state->debug && (state->log != NULL)) {
|
||||
|
|
@ -1674,7 +1674,7 @@ dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
record = makerecord(state, new_name, rdatastr);
|
||||
free(new_name);
|
||||
if (record == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* Write out data to database */
|
||||
|
|
@ -1708,7 +1708,7 @@ dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
|
||||
cleanup:
|
||||
free(record);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -1721,12 +1721,12 @@ dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
isc_result_t result;
|
||||
|
||||
if (txn == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
new_name = relname(name, txn->zone);
|
||||
if (new_name == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
if (state->debug && (state->log != NULL)) {
|
||||
|
|
@ -1737,7 +1737,7 @@ dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
record = makerecord(state, new_name, rdatastr);
|
||||
free(new_name);
|
||||
if (record == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
/*
|
||||
* If 'type' isn't 'SOA', delete the records
|
||||
|
|
@ -1759,7 +1759,7 @@ dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata,
|
|||
|
||||
cleanup:
|
||||
free(record);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -1771,12 +1771,12 @@ dlz_delrdataset(const char *name, const char *type, void *dbdata,
|
|||
isc_result_t result;
|
||||
|
||||
if (txn == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
new_name = relname(name, txn->zone);
|
||||
if (new_name == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
if (state->debug && (state->log != NULL)) {
|
||||
|
|
@ -1796,5 +1796,5 @@ dlz_delrdataset(const char *name, const char *type, void *dbdata,
|
|||
|
||||
cleanup:
|
||||
free(new_name);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ b9_add_helper(config_data_t *state, const char *helper_name, void *ptr) {
|
|||
int
|
||||
dlz_version(unsigned int *flags) {
|
||||
UNUSED(flags);
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -221,7 +221,7 @@ CLEAN_UP_AND_RETURN:
|
|||
carp("DLZ Perl: Returning from allnodes, r = %i, retval = %i", r,
|
||||
retval);
|
||||
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -285,7 +285,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
PUTBACK;
|
||||
FREETMPS;
|
||||
LEAVE;
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if DLZ_DLOPEN_VERSION < 3
|
||||
|
|
@ -356,7 +356,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
PUTBACK;
|
||||
FREETMPS;
|
||||
LEAVE;
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if DLZ_DLOPEN_VERSION == 1
|
||||
|
|
@ -473,7 +473,7 @@ CLEAN_UP_AND_RETURN:
|
|||
|
||||
carp("DLZ Perl: Returning from lookup, r = %i, retval = %i", r, retval);
|
||||
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
|
@ -492,12 +492,12 @@ missing_perl_method(const char *perl_class_name)
|
|||
methods[i]);
|
||||
|
||||
if (get_cv(full_name, 0) == NULL) {
|
||||
return (methods[i]);
|
||||
return methods[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -517,7 +517,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
|
||||
cd = malloc(sizeof(config_data_t));
|
||||
if (cd == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
memset(cd, 0, sizeof(config_data_t));
|
||||
|
|
@ -533,14 +533,14 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
cd->log(ISC_LOG_ERROR,
|
||||
"DLZ Perl '%s': Missing script argument.", dlzname);
|
||||
free(cd);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (argc < 3) {
|
||||
cd->log(ISC_LOG_ERROR,
|
||||
"DLZ Perl '%s': Missing class name argument.", dlzname);
|
||||
free(cd);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
perl_class_name = argv[2];
|
||||
|
||||
|
|
@ -565,7 +565,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
cd->perl = perl_alloc();
|
||||
if (cd->perl == NULL) {
|
||||
free(cd);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
#ifdef MULTIPLICITY
|
||||
my_perl = cd->perl;
|
||||
|
|
@ -586,7 +586,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
cd->perl_source = strdup(argv[1]);
|
||||
if (cd->perl_source == NULL) {
|
||||
free(cd);
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
perlrun[1] = cd->perl_source;
|
||||
|
|
@ -677,7 +677,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
#ifndef MULTIPLICITY
|
||||
global_perl = cd->perl;
|
||||
#endif /* ifndef MULTIPLICITY */
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
CLEAN_UP_PERL_AND_FAIL:
|
||||
PL_perl_destruct_level = 1;
|
||||
|
|
@ -685,7 +685,7 @@ CLEAN_UP_PERL_AND_FAIL:
|
|||
perl_free(cd->perl);
|
||||
free(cd->perl_source);
|
||||
free(cd);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ sqlite3_find_avail(sqlite3_instance_t *sqlite3) {
|
|||
while (count < dbc_search_limit) {
|
||||
/* try to lock on the mutex */
|
||||
if (dlz_mutex_trylock(&dbi->lock) == 0) {
|
||||
return (dbi); /* success, return the DBI for use. */
|
||||
return dbi; /* success, return the DBI for use. */
|
||||
}
|
||||
/* not successful, keep trying */
|
||||
dbi = DLZ_LIST_NEXT(dbi, link);
|
||||
|
|
@ -169,7 +169,7 @@ sqlite3_find_avail(sqlite3_instance_t *sqlite3) {
|
|||
"SQLite3 module: unable to find available connection "
|
||||
"after searching %d times",
|
||||
count);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -189,13 +189,13 @@ escape_string(const char *instr) {
|
|||
unsigned int i;
|
||||
|
||||
if (instr == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
len = strlen(instr);
|
||||
atlen = (2 * len * sizeof(char)) + 1;
|
||||
outstr = malloc(atlen);
|
||||
if (outstr == NULL) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = outstr;
|
||||
|
|
@ -214,7 +214,7 @@ escape_string(const char *instr) {
|
|||
}
|
||||
*ptr = '\0';
|
||||
|
||||
return (outstr);
|
||||
return outstr;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -248,7 +248,7 @@ sqlite3_get_resultset(const char *zone, const char *record, const char *client,
|
|||
dbi = sqlite3_find_avail(db);
|
||||
|
||||
if (dbi == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* what type of query are we going to run? */
|
||||
|
|
@ -431,7 +431,7 @@ cleanup:
|
|||
free(querystring);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -450,7 +450,7 @@ dlz_sqlite3_fetch_row(sqlite3_res_t *rs) {
|
|||
rs->curRow++;
|
||||
}
|
||||
}
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
|
|
@ -459,7 +459,7 @@ dlz_sqlite3_num_fields(sqlite3_res_t *rs) {
|
|||
if (rs != NULL) {
|
||||
retval = rs->pnColumn;
|
||||
}
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
|
|
@ -468,7 +468,7 @@ dlz_sqlite3_num_rows(sqlite3_res_t *rs) {
|
|||
if (rs != NULL) {
|
||||
retval = rs->pnRow;
|
||||
}
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -524,7 +524,7 @@ dlz_sqlite3_process_rs(sqlite3_instance_t *db, dns_sdlzlookup_t *lookup,
|
|||
db->log(ISC_LOG_ERROR, "SQLite3 module: TTL "
|
||||
"must be "
|
||||
"a positive number");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = db->putrr(lookup, safeGet(row[1]), ttl,
|
||||
|
|
@ -551,7 +551,7 @@ dlz_sqlite3_process_rs(sqlite3_instance_t *db, dns_sdlzlookup_t *lookup,
|
|||
"memory for temporary "
|
||||
"string");
|
||||
dlz_sqlite3_free_result(rs);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
strcpy(tmpString, safeGet(row[2]));
|
||||
|
|
@ -566,7 +566,7 @@ dlz_sqlite3_process_rs(sqlite3_instance_t *db, dns_sdlzlookup_t *lookup,
|
|||
"must be "
|
||||
"a positive number");
|
||||
free(tmpString);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
result = db->putrr(lookup, safeGet(row[1]), ttl,
|
||||
|
|
@ -578,14 +578,14 @@ dlz_sqlite3_process_rs(sqlite3_instance_t *db, dns_sdlzlookup_t *lookup,
|
|||
dlz_sqlite3_free_result(rs);
|
||||
db->log(ISC_LOG_ERROR, "putrr returned error: %d",
|
||||
result);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
row = dlz_sqlite3_fetch_row(rs);
|
||||
}
|
||||
|
||||
dlz_sqlite3_free_result(rs);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -613,7 +613,7 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
db->log(ISC_LOG_ERROR, "SQLite3 module: unable to return "
|
||||
"result set for FINDZONE query");
|
||||
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -624,10 +624,10 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
if (rows > 0) {
|
||||
sqlite3_get_resultset(name, NULL, NULL, COUNTZONE, dbdata,
|
||||
NULL);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/*% Determine if the client is allowed to perform a zone transfer */
|
||||
|
|
@ -641,7 +641,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
/* first check if the zone is supported by the database. */
|
||||
result = dlz_findzonedb(dbdata, name, NULL, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -653,7 +653,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
result = sqlite3_get_resultset(name, NULL, client, ALLOWXFR, dbdata,
|
||||
&rs);
|
||||
if (result == ISC_R_NOTIMPLEMENTED) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result != ISC_R_SUCCESS || rs == NULL) {
|
||||
|
|
@ -662,7 +662,7 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
}
|
||||
db->log(ISC_LOG_ERROR, "SQLite3 module: unable to return "
|
||||
"result set for ALLOWXFR query");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -672,10 +672,10 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
rows = dlz_sqlite3_num_rows(rs);
|
||||
dlz_sqlite3_free_result(rs);
|
||||
if (rows > 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (ISC_R_NOPERM);
|
||||
return ISC_R_NOPERM;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -697,7 +697,7 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
|
||||
result = sqlite3_get_resultset(zone, NULL, NULL, ALLNODES, dbdata, &rs);
|
||||
if (result == ISC_R_NOTIMPLEMENTED) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* if we didn't get a result set, log an err msg. */
|
||||
|
|
@ -780,7 +780,7 @@ cleanup:
|
|||
dlz_sqlite3_free_result(rs);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -796,7 +796,7 @@ dlz_authority(const char *zone, void *dbdata, dns_sdlzlookup_t *lookup) {
|
|||
result = sqlite3_get_resultset(zone, NULL, NULL, AUTHORITY, dbdata,
|
||||
&rs);
|
||||
if (result == ISC_R_NOTIMPLEMENTED) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
@ -805,14 +805,14 @@ dlz_authority(const char *zone, void *dbdata, dns_sdlzlookup_t *lookup) {
|
|||
}
|
||||
db->log(ISC_LOG_ERROR, "SQLite3 module: unable to return "
|
||||
"result set for AUTHORITY query");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
* lookup and authority result sets are processed in the same
|
||||
* manner: dlz_sqlite3_process_rs does the job for both functions.
|
||||
*/
|
||||
return (dlz_sqlite3_process_rs(db, lookup, rs));
|
||||
return dlz_sqlite3_process_rs(db, lookup, rs);
|
||||
}
|
||||
|
||||
/*% If zone is supported, lookup up a (or multiple) record(s) in it */
|
||||
|
|
@ -836,14 +836,14 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
}
|
||||
db->log(ISC_LOG_ERROR, "SQLite3 module: unable to return "
|
||||
"result set for LOOKUP query");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
* lookup and authority result sets are processed in the same
|
||||
* manner: dlz_sqlite3_process_rs does the job for both functions.
|
||||
*/
|
||||
return (dlz_sqlite3_process_rs(db, lookup, rs));
|
||||
return dlz_sqlite3_process_rs(db, lookup, rs);
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -867,7 +867,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
/* allocate memory for SQLite3 instance */
|
||||
s3 = calloc(1, sizeof(sqlite3_instance_t));
|
||||
if (s3 == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
memset(s3, 0, sizeof(sqlite3_instance_t));
|
||||
|
||||
|
|
@ -885,14 +885,14 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
if (argc < 4) {
|
||||
s3->log(ISC_LOG_ERROR, "SQLite3 module requires "
|
||||
"at least 4 command line args.");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* no more than 8 arg's should be passed to the module */
|
||||
if (argc > 8) {
|
||||
s3->log(ISC_LOG_ERROR, "SQLite3 module cannot accept "
|
||||
"more than 8 command line args.");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
/* get db name - required */
|
||||
|
|
@ -1002,12 +1002,12 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
}
|
||||
|
||||
*dbdata = s3;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
dlz_destroy(s3);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -1033,7 +1033,7 @@ int
|
|||
dlz_version(unsigned int *flags) {
|
||||
*flags |= (DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA |
|
||||
DNS_SDLZFLAG_THREADSAFE);
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ done:
|
|||
free(querystring);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -173,9 +173,9 @@ dlz_allowzonexfr(void *dbdata, const char *name, const char *client) {
|
|||
"dlz_wildcard allowzonexfr called for client '%s'", client);
|
||||
|
||||
if (fnmatch(cd->axfr_pattern, client, FNM_CASEFOLD) == 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -198,13 +198,13 @@ dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
|||
|
||||
p = shortest_match(cd->zone_pattern, name);
|
||||
if (p == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
/* Write info message to log */
|
||||
cd->log(ISC_LOG_DEBUG(1), "dlz_wildcard findzonedb matched '%s'", p);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
#if DLZ_DLOPEN_VERSION == 1
|
||||
|
|
@ -232,7 +232,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
|
||||
p = shortest_match(cd->zone_pattern, zone);
|
||||
if (p == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
DE_CONST(name, cd->record);
|
||||
|
|
@ -243,7 +243,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
size_t len = p - zone;
|
||||
namebuf = malloc(len);
|
||||
if (namebuf == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
strncpy(namebuf, zone, len - 1);
|
||||
namebuf[len - 1] = '\0';
|
||||
|
|
@ -299,7 +299,7 @@ done:
|
|||
free(querystring);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -312,7 +312,7 @@ dlz_authority(const char *zone, void *dbdata, dns_sdlzlookup_t *lookup) {
|
|||
|
||||
p = shortest_match(cd->zone_pattern, zone);
|
||||
if (p == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
DE_CONST(p, cd->zone);
|
||||
|
|
@ -355,7 +355,7 @@ done:
|
|||
free(querystring);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -397,12 +397,12 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
va_list ap;
|
||||
|
||||
if (argc < 8 || argc % 4 != 0) {
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
cd = calloc(1, sizeof(config_data_t));
|
||||
if (cd == NULL) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
memset(cd, 0, sizeof(config_data_t));
|
||||
|
||||
|
|
@ -480,7 +480,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
|
|||
|
||||
*dbdata = cd;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
full_cleanup:
|
||||
destroy_rrlist(cd);
|
||||
|
|
@ -494,7 +494,7 @@ cleanup:
|
|||
}
|
||||
free(cd);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -520,7 +520,7 @@ int
|
|||
dlz_version(unsigned int *flags) {
|
||||
UNUSED(flags);
|
||||
/* XXX: ok to set DNS_SDLZFLAG_THREADSAFE here? */
|
||||
return (DLZ_DLOPEN_VERSION);
|
||||
return DLZ_DLOPEN_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -546,22 +546,22 @@ static const char *
|
|||
shortest_match(const char *pattern, const char *string) {
|
||||
const char *p = string;
|
||||
if (pattern == NULL || p == NULL || *p == '\0') {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p += strlen(p);
|
||||
while (p-- > string) {
|
||||
if (*p == '.') {
|
||||
if (fnmatch(pattern, p + 1, FNM_CASEFOLD) == 0) {
|
||||
return (p + 1);
|
||||
return p + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fnmatch(pattern, string, FNM_CASEFOLD) == 0) {
|
||||
return (string);
|
||||
return string;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -588,21 +588,21 @@ fnmatch(const char *pattern, const char *string, int flags) {
|
|||
switch (c = *pattern++) {
|
||||
case EOS:
|
||||
if ((flags & FNM_LEADING_DIR) && *string == '/') {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
return (*string == EOS ? 0 : FNM_NOMATCH);
|
||||
return *string == EOS ? 0 : FNM_NOMATCH;
|
||||
case '?':
|
||||
if (*string == EOS) {
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
if (*string == '/' && (flags & FNM_PATHNAME)) {
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
if (*string == '.' && (flags & FNM_PERIOD) &&
|
||||
(string == stringstart ||
|
||||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
|
||||
{
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
++string;
|
||||
break;
|
||||
|
|
@ -617,24 +617,24 @@ fnmatch(const char *pattern, const char *string, int flags) {
|
|||
(string == stringstart ||
|
||||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
|
||||
{
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
/* Optimize for pattern with * at end or before /. */
|
||||
if (c == EOS) {
|
||||
if (flags & FNM_PATHNAME) {
|
||||
return ((flags & FNM_LEADING_DIR) ||
|
||||
index(string,
|
||||
'/') ==
|
||||
NULL
|
||||
? 0
|
||||
: FNM_NOMATCH);
|
||||
return (flags & FNM_LEADING_DIR) ||
|
||||
index(string,
|
||||
'/') ==
|
||||
NULL
|
||||
? 0
|
||||
: FNM_NOMATCH;
|
||||
} else {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
} else if (c == '/' && flags & FNM_PATHNAME) {
|
||||
if ((string = index(string, '/')) == NULL) {
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -644,26 +644,26 @@ fnmatch(const char *pattern, const char *string, int flags) {
|
|||
if (!fnmatch(pattern, string,
|
||||
flags & ~FNM_PERIOD))
|
||||
{
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
if (test == '/' && flags & FNM_PATHNAME) {
|
||||
break;
|
||||
}
|
||||
++string;
|
||||
}
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
case '[':
|
||||
if (*string == EOS) {
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
if (*string == '/' && (flags & FNM_PATHNAME)) {
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
if (*string == '.' && (flags & FNM_PERIOD) &&
|
||||
(string == stringstart ||
|
||||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
|
||||
{
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
switch (rangematch(pattern, *string, flags, &newp)) {
|
||||
|
|
@ -673,7 +673,7 @@ fnmatch(const char *pattern, const char *string, int flags) {
|
|||
pattern = newp;
|
||||
break;
|
||||
case RANGE_NOMATCH:
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
++string;
|
||||
break;
|
||||
|
|
@ -693,7 +693,7 @@ fnmatch(const char *pattern, const char *string, int flags) {
|
|||
tolower((unsigned char)*string)))
|
||||
{
|
||||
} else {
|
||||
return (FNM_NOMATCH);
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
string++;
|
||||
break;
|
||||
|
|
@ -734,11 +734,11 @@ rangematch(const char *pattern, char test, int flags, char **newp) {
|
|||
c = *pattern++;
|
||||
}
|
||||
if (c == EOS) {
|
||||
return (RANGE_ERROR);
|
||||
return RANGE_ERROR;
|
||||
}
|
||||
|
||||
if (c == '/' && (flags & FNM_PATHNAME)) {
|
||||
return (RANGE_NOMATCH);
|
||||
return RANGE_NOMATCH;
|
||||
}
|
||||
|
||||
if (flags & FNM_CASEFOLD) {
|
||||
|
|
@ -753,7 +753,7 @@ rangematch(const char *pattern, char test, int flags, char **newp) {
|
|||
c2 = *pattern++;
|
||||
}
|
||||
if (c2 == EOS) {
|
||||
return (RANGE_ERROR);
|
||||
return RANGE_ERROR;
|
||||
}
|
||||
|
||||
if (flags & FNM_CASEFOLD) {
|
||||
|
|
@ -769,5 +769,5 @@ rangematch(const char *pattern, char test, int flags, char **newp) {
|
|||
} while ((c = *pattern++) != ']');
|
||||
|
||||
*newp = (char *)(uintptr_t)pattern;
|
||||
return (ok == negate ? RANGE_NOMATCH : RANGE_MATCH);
|
||||
return ok == negate ? RANGE_NOMATCH : RANGE_MATCH;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,8 +188,8 @@ main(int argc, char **argv) {
|
|||
fflush(stdout);
|
||||
if (ferror(stdout)) {
|
||||
fprintf(stderr, "write error\n");
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ int
|
|||
LLVMFuzzerInitialize(int *argc, char ***argv) {
|
||||
UNUSED(argc);
|
||||
UNUSED(argv);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -74,5 +74,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
end:
|
||||
dns_db_detach(&db);
|
||||
isc_mem_destroy(&mctx);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,14 +195,14 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
wd = mkdtemp(template);
|
||||
if (wd == NULL) {
|
||||
fprintf(stderr, "mkdtemp failed\n");
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
snprintf(pathbuf, sizeof(pathbuf), "%s/%s", wd, f1);
|
||||
fd = fopen(pathbuf, "w");
|
||||
if (fd == NULL) {
|
||||
fprintf(stderr, "fopen(%s) failed\n", pathbuf);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
fputs(c1, fd);
|
||||
fclose(fd);
|
||||
|
|
@ -211,7 +211,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
fd = fopen(pathbuf, "w");
|
||||
if (fd == NULL) {
|
||||
fprintf(stderr, "fopen(%s) failed\n", pathbuf);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
fputs(c2, fd);
|
||||
fclose(fd);
|
||||
|
|
@ -220,7 +220,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
fd = fopen(pathbuf, "w");
|
||||
if (fd == NULL) {
|
||||
fprintf(stderr, "fopen(%s) failed\n", pathbuf);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
fputs(c3, fd);
|
||||
fclose(fd);
|
||||
|
|
@ -231,7 +231,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dst_lib_init failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
destroy_dst = true;
|
||||
|
||||
|
|
@ -239,28 +239,28 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_view_create failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_tsigkeyring_create(mctx, &ring);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_tsigkeyring_create failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_tsigkeyring_create(mctx, &emptyring);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_tsigkeyring_create failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_name_fromstring(name, "tsig-key", 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_name_fromstring failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_tsigkey_create(name, dns_tsig_hmacsha256_name, secret,
|
||||
|
|
@ -269,28 +269,28 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_tsigkey_create failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_name_fromstring(name, "sig0key", 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_name_fromstring failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_zone_create(&zone, mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_zone_create failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_zone_setorigin(zone, name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_zone_setorigin failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
dns_zone_setclass(zone, view->rdclass);
|
||||
|
|
@ -300,7 +300,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_zone_setkeydirectory failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_zone_setfile(zone, pathbuf, dns_masterformat_text,
|
||||
|
|
@ -308,28 +308,28 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_zone_setfile failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_zone_load(zone, false);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_zone_load failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = dns_view_addzone(view, zone);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_view_addzone failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
dns_view_freeze(view);
|
||||
|
||||
dns_zone_detach(&zone);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -405,7 +405,7 @@ create_message(dns_message_t **messagep, const uint8_t *data, size_t size,
|
|||
}
|
||||
*messagep = message;
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -434,7 +434,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
* opcode.
|
||||
*/
|
||||
if (size > 65535 || size < 2) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
addasig = (*data & 0x80) != 0;
|
||||
|
|
@ -459,7 +459,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
|
||||
result = create_message(&message, data, size, addasig, addtsig);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -538,5 +538,5 @@ cleanup:
|
|||
dns_message_detach(&message);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
isc_mem_create(&mctx);
|
||||
output = isc_mem_get(mctx, output_len);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -62,7 +62,7 @@ parse_message(isc_buffer_t *input, dns_message_t **messagep) {
|
|||
dns_message_detach(&message);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -87,7 +87,7 @@ print_message(dns_message_t *message) {
|
|||
output);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define CHECKRESULT(r, f) \
|
||||
|
|
@ -114,7 +114,7 @@ render_message(dns_message_t **messagep) {
|
|||
|
||||
result = dns_compress_init(&cctx, -1, mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
CHECKRESULT(result, dns_message_renderbegin(message, &cctx, &buffer));
|
||||
|
||||
|
|
@ -139,11 +139,11 @@ render_message(dns_message_t **messagep) {
|
|||
|
||||
result = parse_message(&buffer, messagep);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
|
||||
cleanup:
|
||||
dns_compress_invalidate(&cctx);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -153,7 +153,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
dns_message_t *message = NULL;
|
||||
|
||||
if (size > 65535) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
isc_buffer_constinit(&buffer, data, size);
|
||||
|
|
@ -185,5 +185,5 @@ cleanup:
|
|||
dns_message_detach(&message);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ bool debug = false;
|
|||
int
|
||||
LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
||||
char ***argv __attribute__((unused))) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -48,5 +48,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
fprintf(stderr, "dns_name_fromtext: %s\n",
|
||||
isc_result_totext(result));
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ int
|
|||
LLVMFuzzerInitialize(int *argc, char ***argv) {
|
||||
UNUSED(argc);
|
||||
UNUSED(argv);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* following code was copied from named-rrchecker */
|
||||
|
|
@ -147,5 +147,5 @@ cleanup:
|
|||
isc_lex_close(lex);
|
||||
isc_lex_destroy(&lex);
|
||||
isc_mem_destroy(&mctx);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
isc_lex_setspecials(lex, specials);
|
||||
isc_lex_setcomments(lex, ISC_LEXCOMMENT_DNSMASTERFILE);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -101,7 +101,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
* dns_rdata_fromwire() only accepts input up to 2^16-1 octets.
|
||||
*/
|
||||
if (size < 2 || size > 0xffff + 2) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -215,5 +215,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
assert(target.used == size);
|
||||
assert(!memcmp(target.base, data, size));
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
result = isc_lex_create(mctx, 1024, &lex);
|
||||
REQUIRE(result == ISC_R_SUCCESS);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -56,7 +56,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
bool eol;
|
||||
|
||||
if (size < sizeof(expect) + sizeof(eol)) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
(void)memmove(&expect, data, sizeof(expect));
|
||||
|
|
@ -77,5 +77,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
result = isc_lex_getmastertoken(lex, &token, expect, eol);
|
||||
} while (result == ISC_R_SUCCESS && token.type != isc_tokentype_eof);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
|
|||
result = isc_lex_create(mctx, 1024, &lex);
|
||||
REQUIRE(result == ISC_R_SUCCESS);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -55,5 +55,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
result = isc_lex_gettoken(lex, 0, &token);
|
||||
} while (result == ISC_R_SUCCESS);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ main(int argc, char **argv) {
|
|||
argc--;
|
||||
}
|
||||
POST(argc);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
target = (target != NULL) ? target + 1 : argv[0];
|
||||
|
|
@ -129,7 +129,7 @@ main(int argc, char **argv) {
|
|||
|
||||
test_all_from(corpusdir);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif __AFL_COMPILER
|
||||
|
|
@ -152,13 +152,13 @@ main(int argc, char **argv) {
|
|||
#endif /* ifdef __AFL_LOOP */
|
||||
ret = fread(buf, 1, sizeof(buf), stdin);
|
||||
if (ret < 0) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LLVMFuzzerTestOneInput(buf, ret);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) {
|
|||
result = ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -188,7 +188,7 @@ check_order(const cfg_obj_t *options, isc_log_t *logctx) {
|
|||
const cfg_obj_t *obj = NULL;
|
||||
|
||||
if (cfg_map_get(options, "rrset-order", &obj) != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
for (element = cfg_list_first(obj); element != NULL;
|
||||
|
|
@ -199,7 +199,7 @@ check_order(const cfg_obj_t *options, isc_log_t *logctx) {
|
|||
result = tresult;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -218,7 +218,7 @@ check_dual_stack(const cfg_obj_t *options, isc_log_t *logctx) {
|
|||
(void)cfg_map_get(options, "dual-stack-servers", &alternates);
|
||||
|
||||
if (alternates == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
obj = cfg_tuple_get(alternates, "port");
|
||||
|
|
@ -266,7 +266,7 @@ check_dual_stack(const cfg_obj_t *options, isc_log_t *logctx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -285,14 +285,14 @@ check_forward(const cfg_obj_t *options, const cfg_obj_t *global,
|
|||
"forwarders declared in root zone and "
|
||||
"in general configuration: %s:%u",
|
||||
file, line);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
if (forward != NULL && forwarders == NULL) {
|
||||
cfg_obj_log(forward, logctx, ISC_LOG_ERROR,
|
||||
"no matching 'forwarders' statement");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -337,7 +337,7 @@ disabled_algorithms(const cfg_obj_t *disabled, isc_log_t *logctx) {
|
|||
result = tresult;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -383,7 +383,7 @@ disabled_ds_digests(const cfg_obj_t *disabled, isc_log_t *logctx) {
|
|||
result = tresult;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -415,7 +415,7 @@ nameexist(const cfg_obj_t *obj, const char *name, int value,
|
|||
} else if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_free(mctx, key);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -445,7 +445,7 @@ mustbesecure(const cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx,
|
|||
"exists previous definition: %s:%u",
|
||||
logctx, mctx);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -472,7 +472,7 @@ checkacl(const char *aclname, cfg_aclconfctx_t *actx, const cfg_obj_t *zconfig,
|
|||
}
|
||||
}
|
||||
if (aclobj == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
result = cfg_acl_fromconfig(aclobj, config, logctx, actx, mctx, 0,
|
||||
&acl);
|
||||
|
|
@ -522,7 +522,7 @@ checkacl(const char *aclname, cfg_aclconfctx_t *actx, const cfg_obj_t *zconfig,
|
|||
}
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -546,7 +546,7 @@ check_viewacls(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
|
|||
result = tresult;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -584,7 +584,7 @@ check_dns64(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
|
|||
}
|
||||
}
|
||||
if (dns64 == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
for (element = cfg_list_first(dns64); element != NULL;
|
||||
|
|
@ -664,7 +664,7 @@ check_dns64(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define CHECK_RRL(cond, pat, val1, val2) \
|
||||
|
|
@ -716,7 +716,7 @@ check_ratelimit(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
|
|||
}
|
||||
}
|
||||
if (map == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
min_entries = 500;
|
||||
|
|
@ -802,7 +802,7 @@ check_ratelimit(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -885,7 +885,7 @@ check_recursionacls(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -914,7 +914,7 @@ check_name(const char *str) {
|
|||
dns_fixedname_t fixed;
|
||||
|
||||
dns_fixedname_init(&fixed);
|
||||
return (dns_name_fromstring(dns_fixedname_name(&fixed), str, 0, NULL));
|
||||
return dns_name_fromstring(dns_fixedname_name(&fixed), str, 0, NULL);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -923,15 +923,15 @@ kasp_name_allowed(const cfg_listelt_t *element) {
|
|||
cfg_tuple_get(cfg_listelt_value(element), "name"));
|
||||
|
||||
if (strcmp("none", name) == 0) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
if (strcmp("default", name) == 0) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
if (strcmp("insecure", name) == 0) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static const cfg_obj_t *
|
||||
|
|
@ -945,7 +945,7 @@ find_maplist(const cfg_obj_t *config, const char *listname, const char *name) {
|
|||
|
||||
result = cfg_map_get(config, listname, &maplist);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (elt = cfg_list_first(maplist); elt != NULL;
|
||||
|
|
@ -955,11 +955,11 @@ find_maplist(const cfg_obj_t *config, const char *listname, const char *name) {
|
|||
if (strcasecmp(cfg_obj_asstring(cfg_map_getname(map)), name) ==
|
||||
0)
|
||||
{
|
||||
return (map);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1044,7 +1044,7 @@ check_listener(const cfg_obj_t *listener, const cfg_obj_t *config,
|
|||
dns_acl_detach(&acl);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1062,7 +1062,7 @@ check_listeners(const cfg_obj_t *list, const cfg_obj_t *config,
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1073,20 +1073,20 @@ check_port(const cfg_obj_t *options, isc_log_t *logctx, const char *type,
|
|||
|
||||
result = cfg_map_get(options, type, &portobj);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (cfg_obj_asuint32(portobj) >= UINT16_MAX) {
|
||||
cfg_obj_log(portobj, logctx, ISC_LOG_ERROR,
|
||||
"port '%u' out of range",
|
||||
cfg_obj_asuint32(portobj));
|
||||
return (ISC_R_RANGE);
|
||||
return ISC_R_RANGE;
|
||||
}
|
||||
|
||||
if (portp != NULL) {
|
||||
*portp = (in_port_t)cfg_obj_asuint32(portobj);
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1961,7 +1961,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
|||
cfg_aclconfctx_detach(&actx);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1978,7 +1978,7 @@ bind9_check_remoteserverlist(const cfg_obj_t *cctx, const char *list,
|
|||
|
||||
result = cfg_map_get(cctx, list, &obj);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
elt = cfg_list_first(obj);
|
||||
|
|
@ -2021,7 +2021,7 @@ bind9_check_remoteserverlist(const cfg_obj_t *cctx, const char *list,
|
|||
|
||||
elt = cfg_list_next(elt);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2035,7 +2035,7 @@ bind9_check_primarylists(const cfg_obj_t *cctx, isc_log_t *logctx,
|
|||
|
||||
result = isc_symtab_create(mctx, 100, freekey, mctx, false, &symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
tresult = bind9_check_remoteserverlist(cctx, "primaries", logctx,
|
||||
symtab, mctx);
|
||||
|
|
@ -2048,7 +2048,7 @@ bind9_check_primarylists(const cfg_obj_t *cctx, isc_log_t *logctx,
|
|||
result = tresult;
|
||||
}
|
||||
isc_symtab_destroy(&symtab);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2062,7 +2062,7 @@ bind9_check_parentalagentlists(const cfg_obj_t *cctx, isc_log_t *logctx,
|
|||
|
||||
result = isc_symtab_create(mctx, 100, freekey, mctx, false, &symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
tresult = bind9_check_remoteserverlist(cctx, "parental-agents", logctx,
|
||||
symtab, mctx);
|
||||
|
|
@ -2070,7 +2070,7 @@ bind9_check_parentalagentlists(const cfg_obj_t *cctx, isc_log_t *logctx,
|
|||
result = tresult;
|
||||
}
|
||||
isc_symtab_destroy(&symtab);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#if HAVE_LIBNGHTTP2
|
||||
|
|
@ -2134,7 +2134,7 @@ bind9_check_httpserver(const cfg_obj_t *http, isc_log_t *logctx,
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2147,7 +2147,7 @@ bind9_check_httpservers(const cfg_obj_t *config, isc_log_t *logctx,
|
|||
|
||||
result = isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = cfg_map_get(config, "http", &obj);
|
||||
|
|
@ -2166,7 +2166,7 @@ bind9_check_httpservers(const cfg_obj_t *config, isc_log_t *logctx,
|
|||
|
||||
done:
|
||||
isc_symtab_destroy(&symtab);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
#endif /* HAVE_LIBNGHTTP2 */
|
||||
|
||||
|
|
@ -2290,7 +2290,7 @@ bind9_check_tls_defintion(const cfg_obj_t *tlsobj, const char *name,
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2304,12 +2304,12 @@ bind9_check_tls_definitions(const cfg_obj_t *config, isc_log_t *logctx,
|
|||
result = cfg_map_get(config, "tls", &obj);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
result = ISC_R_SUCCESS;
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
for (elt = cfg_list_first(obj); elt != NULL; elt = cfg_list_next(elt)) {
|
||||
|
|
@ -2324,7 +2324,7 @@ bind9_check_tls_definitions(const cfg_obj_t *config, isc_log_t *logctx,
|
|||
|
||||
isc_symtab_destroy(&symtab);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2336,7 +2336,7 @@ get_remotes(const cfg_obj_t *cctx, const char *list, const char *name,
|
|||
|
||||
result = cfg_map_get(cctx, list, &obj);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
elt = cfg_list_first(obj);
|
||||
|
|
@ -2348,13 +2348,13 @@ get_remotes(const cfg_obj_t *cctx, const char *list, const char *name,
|
|||
|
||||
if (strcasecmp(listname, name) == 0) {
|
||||
*ret = obj;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
elt = cfg_list_next(elt);
|
||||
}
|
||||
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2370,7 +2370,7 @@ get_remoteservers_def(const char *list, const char *name, const cfg_obj_t *cctx,
|
|||
} else if (strcmp(list, "parental-agents") == 0) {
|
||||
result = get_remotes(cctx, "parental-agents", name, ret);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2391,7 +2391,7 @@ validate_remotes(const char *list, const cfg_obj_t *obj,
|
|||
result = isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
*countp = count;
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
newlist:
|
||||
|
|
@ -2524,7 +2524,7 @@ resume:
|
|||
}
|
||||
isc_symtab_destroy(&symtab);
|
||||
*countp = count;
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2543,7 +2543,7 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
|
|||
if (cfg_obj_isstring(policy) &&
|
||||
strcmp("local", cfg_obj_asstring(policy)) == 0)
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/* Now check the grant policy */
|
||||
|
|
@ -2701,7 +2701,7 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -2731,7 +2731,7 @@ check_nonzero(const cfg_obj_t *options, isc_log_t *logctx) {
|
|||
result = ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2749,7 +2749,7 @@ check_mirror_zone_notify(const cfg_obj_t *zoptions, const char *znamestr,
|
|||
/*
|
||||
* "notify" not set at zone level. This is fine.
|
||||
*/
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (cfg_obj_isboolean(obj)) {
|
||||
|
|
@ -2777,7 +2777,7 @@ check_mirror_zone_notify(const cfg_obj_t *zoptions, const char *znamestr,
|
|||
znamestr);
|
||||
}
|
||||
|
||||
return (notify_configuration_ok);
|
||||
return notify_configuration_ok;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2838,7 +2838,7 @@ cleanup:
|
|||
dns_acl_detach(&acl);
|
||||
}
|
||||
|
||||
return (retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -2909,7 +2909,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
if (obj == NULL) {
|
||||
cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR,
|
||||
"zone '%s': type not present", znamestr);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
typestr = cfg_obj_asstring(obj);
|
||||
|
|
@ -2944,13 +2944,13 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"zone '%s': invalid type %s", znamestr,
|
||||
typestr);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (ztype == CFG_ZONE_REDIRECT && strcmp(znamestr, ".") != 0) {
|
||||
cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR,
|
||||
"redirect zones must be called \".\"");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2965,14 +2965,14 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"zone '%s': invalid class %s", znamestr,
|
||||
r.base);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
if (zclass != defclass) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"zone '%s': class '%s' does not "
|
||||
"match view/default class",
|
||||
znamestr, r.base);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
} else {
|
||||
zclass = defclass;
|
||||
|
|
@ -3094,7 +3094,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
result = ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -3829,10 +3829,10 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
tresult = cfg_map_get(zoptions, "file", &fileobj);
|
||||
obj = NULL;
|
||||
res1 = cfg_map_get(zoptions, "inline-signing", &obj);
|
||||
if ((tresult != ISC_R_SUCCESS &&
|
||||
(ztype == CFG_ZONE_PRIMARY || ztype == CFG_ZONE_HINT ||
|
||||
(ztype == CFG_ZONE_SECONDARY && res1 == ISC_R_SUCCESS &&
|
||||
cfg_obj_asboolean(obj)))))
|
||||
if (tresult != ISC_R_SUCCESS &&
|
||||
(ztype == CFG_ZONE_PRIMARY || ztype == CFG_ZONE_HINT ||
|
||||
(ztype == CFG_ZONE_SECONDARY && res1 == ISC_R_SUCCESS &&
|
||||
cfg_obj_asboolean(obj))))
|
||||
{
|
||||
cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR,
|
||||
"zone '%s': missing 'file' entry",
|
||||
|
|
@ -3858,7 +3858,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef struct keyalgorithms {
|
||||
|
|
@ -3896,7 +3896,7 @@ bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) {
|
|||
"key '%s' must have both 'secret' and "
|
||||
"'algorithm' defined",
|
||||
keyname);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
isc_buffer_init(&buf, secretbuf, sizeof(secretbuf));
|
||||
|
|
@ -3904,7 +3904,7 @@ bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(secretobj, logctx, ISC_LOG_ERROR, "bad secret '%s'",
|
||||
isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
algorithm = cfg_obj_asstring(algobj);
|
||||
|
|
@ -3920,7 +3920,7 @@ bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) {
|
|||
if (algorithms[i].name == NULL) {
|
||||
cfg_obj_log(algobj, logctx, ISC_LOG_ERROR,
|
||||
"unknown algorithm '%s'", algorithm);
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
if (algorithm[len] == '-') {
|
||||
uint16_t digestbits;
|
||||
|
|
@ -3934,20 +3934,20 @@ bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) {
|
|||
"[%u..%u]",
|
||||
keyname, algorithms[i].size / 2,
|
||||
algorithms[i].size);
|
||||
return (ISC_R_RANGE);
|
||||
return ISC_R_RANGE;
|
||||
}
|
||||
if ((digestbits % 8) != 0) {
|
||||
cfg_obj_log(algobj, logctx, ISC_LOG_ERROR,
|
||||
"key '%s' digest-bits not multiple"
|
||||
" of 8",
|
||||
keyname);
|
||||
return (ISC_R_RANGE);
|
||||
return ISC_R_RANGE;
|
||||
}
|
||||
/*
|
||||
* Recommended minima for hmac algorithms.
|
||||
*/
|
||||
if ((digestbits < (algorithms[i].size / 2U) ||
|
||||
(digestbits < 80U)))
|
||||
if (digestbits < (algorithms[i].size / 2U) ||
|
||||
(digestbits < 80U))
|
||||
{
|
||||
cfg_obj_log(algobj, logctx, ISC_LOG_WARNING,
|
||||
"key '%s' digest-bits too small "
|
||||
|
|
@ -3958,10 +3958,10 @@ bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) {
|
|||
cfg_obj_log(algobj, logctx, ISC_LOG_ERROR,
|
||||
"key '%s': unable to parse digest-bits",
|
||||
keyname);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -3981,7 +3981,7 @@ fileexist(const cfg_obj_t *obj, isc_symtab_t *symtab, bool writeable,
|
|||
"writeable file '%s': already in use: "
|
||||
"%s:%u",
|
||||
cfg_obj_asstring(obj), file, line);
|
||||
return (ISC_R_EXISTS);
|
||||
return ISC_R_EXISTS;
|
||||
}
|
||||
result = isc_symtab_lookup(symtab, cfg_obj_asstring(obj), 2,
|
||||
&symvalue);
|
||||
|
|
@ -3992,16 +3992,16 @@ fileexist(const cfg_obj_t *obj, isc_symtab_t *symtab, bool writeable,
|
|||
"writeable file '%s': already in use: "
|
||||
"%s:%u",
|
||||
cfg_obj_asstring(obj), file, line);
|
||||
return (ISC_R_EXISTS);
|
||||
return ISC_R_EXISTS;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
symvalue.as_cpointer = obj;
|
||||
result = isc_symtab_define(symtab, cfg_obj_asstring(obj),
|
||||
writeable ? 2 : 1, symvalue,
|
||||
isc_symexists_reject);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -4012,7 +4012,7 @@ keydirexist(const cfg_obj_t *zcfg, const char *keydir, const char *kaspnamestr,
|
|||
char *symkey;
|
||||
|
||||
if (kaspnamestr == NULL || strcmp(kaspnamestr, "none") == 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
result = isc_symtab_lookup(symtab, keydir, 0, &symvalue);
|
||||
|
|
@ -4032,7 +4032,7 @@ keydirexist(const cfg_obj_t *zcfg, const char *keydir, const char *kaspnamestr,
|
|||
strcmp(cfg_obj_asstring(kasp), "none") == 0 ||
|
||||
strcmp(cfg_obj_asstring(kasp), kaspnamestr) == 0)
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
cfg_obj_log(zcfg, logctx, ISC_LOG_ERROR,
|
||||
|
|
@ -4041,7 +4041,7 @@ keydirexist(const cfg_obj_t *zcfg, const char *keydir, const char *kaspnamestr,
|
|||
keydir,
|
||||
cfg_obj_asstring(cfg_tuple_get(exist, "name")),
|
||||
cfg_obj_asstring(kasp), file, line);
|
||||
return (ISC_R_EXISTS);
|
||||
return ISC_R_EXISTS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -4051,7 +4051,7 @@ keydirexist(const cfg_obj_t *zcfg, const char *keydir, const char *kaspnamestr,
|
|||
symvalue.as_cpointer = zcfg;
|
||||
result = isc_symtab_define(symtab, symkey, 2, symvalue,
|
||||
isc_symexists_reject);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -4091,7 +4091,7 @@ check_keylist(const cfg_obj_t *keys, isc_symtab_t *symtab, isc_mem_t *mctx,
|
|||
}
|
||||
tresult = bind9_check_key(key, logctx);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
return (tresult);
|
||||
return tresult;
|
||||
}
|
||||
|
||||
dns_name_format(name, namebuf, sizeof(namebuf));
|
||||
|
|
@ -4120,10 +4120,10 @@ check_keylist(const cfg_obj_t *keys, isc_symtab_t *symtab, isc_mem_t *mctx,
|
|||
result = tresult;
|
||||
} else if (tresult != ISC_R_SUCCESS) {
|
||||
isc_mem_free(mctx, keyname);
|
||||
return (tresult);
|
||||
return tresult;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -4138,7 +4138,7 @@ rndckey_exists(const cfg_obj_t *keylist, const char *keyname) {
|
|||
const char *str;
|
||||
|
||||
if (keylist == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (element = cfg_list_first(keylist); element != NULL;
|
||||
|
|
@ -4147,10 +4147,10 @@ rndckey_exists(const cfg_obj_t *keylist, const char *keyname) {
|
|||
obj = cfg_listelt_value(element);
|
||||
str = cfg_obj_asstring(cfg_map_getname(obj));
|
||||
if (!strcasecmp(str, keyname)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
static struct {
|
||||
|
|
@ -4205,7 +4205,7 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
|||
(void)cfg_map_get(config, "server", &servers);
|
||||
}
|
||||
if (servers == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
for (e1 = cfg_list_first(servers); e1 != NULL; e1 = cfg_list_next(e1)) {
|
||||
|
|
@ -4337,7 +4337,7 @@ check_servers(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
|||
}
|
||||
dns_peer_detach(&peer);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define ROOT_KSK_STATIC 0x01
|
||||
|
|
@ -4624,7 +4624,7 @@ check_trust_anchor(const cfg_obj_t *key, bool managed, unsigned int *flagsp,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -4689,7 +4689,7 @@ record_static_keys(isc_symtab_t *symtab, isc_mem_t *mctx,
|
|||
}
|
||||
}
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -4746,7 +4746,7 @@ check_initializing_keys(isc_symtab_t *symtab, const cfg_obj_t *keylist,
|
|||
}
|
||||
}
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -4799,7 +4799,7 @@ record_ds_keys(isc_symtab_t *symtab, isc_mem_t *mctx,
|
|||
}
|
||||
}
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -4914,7 +4914,7 @@ cleanup:
|
|||
if (dstab != NULL) {
|
||||
isc_symtab_destroy(&dstab);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef enum { special_zonetype_rpz, special_zonetype_catz } special_zonetype_t;
|
||||
|
|
@ -4957,7 +4957,7 @@ check_rpz_catz(const char *rpz_catz, const cfg_obj_t *rpz_obj,
|
|||
"more than 64 response policy "
|
||||
"zones in view '%s'",
|
||||
viewname);
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4999,7 +4999,7 @@ check_rpz_catz(const char *rpz_catz, const cfg_obj_t *rpz_obj,
|
|||
}
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -5021,7 +5021,7 @@ check_catz(const cfg_obj_t *catz_obj, const char *viewname, isc_mem_t *mctx,
|
|||
|
||||
result = isc_symtab_create(mctx, 100, freekey, mctx, false, &symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
obj = cfg_tuple_get(catz_obj, "zone list");
|
||||
|
|
@ -5077,7 +5077,7 @@ check_catz(const cfg_obj_t *catz_obj, const char *viewname, isc_mem_t *mctx,
|
|||
isc_symtab_destroy(&symtab);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -5112,7 +5112,7 @@ check_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
|
|||
"%s: plugin check failed: "
|
||||
"unable to get full plugin path: %s",
|
||||
plugin_path, isc_result_totext(result));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = ns_plugin_check(full_path, parameters, config,
|
||||
|
|
@ -5125,7 +5125,7 @@ check_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
|
|||
*data->check_result = result;
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -5152,16 +5152,16 @@ check_dnstap(const cfg_obj_t *voptions, const cfg_obj_t *config,
|
|||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"'dnstap-output' must be set if 'dnstap' "
|
||||
"is set");
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
#else /* ifdef HAVE_DNSTAP */
|
||||
UNUSED(voptions);
|
||||
UNUSED(config);
|
||||
UNUSED(logctx);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
#endif /* ifdef HAVE_DNSTAP */
|
||||
}
|
||||
|
||||
|
|
@ -5210,7 +5210,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
|||
*/
|
||||
tresult = isc_symtab_create(mctx, 1000, freekey, mctx, false, &symtab);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
return (ISC_R_NOMEMORY);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
|
||||
cfg_aclconfctx_create(mctx, &actx);
|
||||
|
|
@ -5577,7 +5577,7 @@ cleanup:
|
|||
cfg_aclconfctx_detach(&actx);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char *default_channels[] = { "default_syslog", "default_stderr",
|
||||
|
|
@ -5607,12 +5607,12 @@ bind9_check_logging(const cfg_obj_t *config, isc_log_t *logctx,
|
|||
|
||||
(void)cfg_map_get(config, "logging", &logobj);
|
||||
if (logobj == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
result = isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
symvalue.as_cpointer = NULL;
|
||||
|
|
@ -5693,7 +5693,7 @@ bind9_check_logging(const cfg_obj_t *config, isc_log_t *logctx,
|
|||
}
|
||||
}
|
||||
isc_symtab_destroy(&symtab);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -5707,7 +5707,7 @@ bind9_check_controlskeys(const cfg_obj_t *control, const cfg_obj_t *keylist,
|
|||
|
||||
control_keylist = cfg_tuple_get(control, "keys");
|
||||
if (cfg_obj_isvoid(control_keylist)) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
for (element = cfg_list_first(control_keylist); element != NULL;
|
||||
|
|
@ -5722,7 +5722,7 @@ bind9_check_controlskeys(const cfg_obj_t *control, const cfg_obj_t *keylist,
|
|||
result = ISC_R_NOTFOUND;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -5746,7 +5746,7 @@ bind9_check_controls(const cfg_obj_t *config, isc_log_t *logctx,
|
|||
|
||||
(void)cfg_map_get(config, "controls", &controlslist);
|
||||
if (controlslist == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
(void)cfg_map_get(config, "key", &keylist);
|
||||
|
|
@ -5826,7 +5826,7 @@ bind9_check_controls(const cfg_obj_t *config, isc_log_t *logctx,
|
|||
}
|
||||
}
|
||||
cfg_aclconfctx_detach(&actx);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -6095,5 +6095,5 @@ cleanup:
|
|||
isc_symtab_destroy(&keydirs);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ bind9_getaddresses(const char *hostname, in_port_t port, isc_sockaddr_t *addrs,
|
|||
isc_sockaddr_v6fromin(&addrs[0], &in4, port);
|
||||
}
|
||||
*addrcount = 1;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
} else if (strlen(hostname) <= 127U) {
|
||||
char tmpbuf[128], *d;
|
||||
uint32_t zone = 0;
|
||||
|
|
@ -78,7 +78,7 @@ bind9_getaddresses(const char *hostname, in_port_t port, isc_sockaddr_t *addrs,
|
|||
isc_netaddr_t na;
|
||||
|
||||
if (!have_ipv6) {
|
||||
return (ISC_R_FAMILYNOSUPPORT);
|
||||
return ISC_R_FAMILYNOSUPPORT;
|
||||
}
|
||||
|
||||
if (d != NULL) {
|
||||
|
|
@ -88,7 +88,7 @@ bind9_getaddresses(const char *hostname, in_port_t port, isc_sockaddr_t *addrs,
|
|||
&in6, &zone);
|
||||
|
||||
if (iresult != ISC_R_SUCCESS) {
|
||||
return (iresult);
|
||||
return iresult;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ bind9_getaddresses(const char *hostname, in_port_t port, isc_sockaddr_t *addrs,
|
|||
&addrs[0], (const isc_netaddr_t *)&na, port);
|
||||
|
||||
*addrcount = 1;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
|
|
@ -124,7 +124,7 @@ again:
|
|||
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
|
||||
case EAI_NODATA:
|
||||
#endif /* if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME) */
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
#ifdef AI_ADDRCONFIG
|
||||
case EAI_BADFLAGS:
|
||||
if ((hints.ai_flags & AI_ADDRCONFIG) != 0) {
|
||||
|
|
@ -134,7 +134,7 @@ again:
|
|||
#endif /* ifdef AI_ADDRCONFIG */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
return (ISC_R_FAILURE);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
for (tmpai = ai, i = 0; tmpai != NULL && i < addrsize;
|
||||
tmpai = tmpai->ai_next)
|
||||
|
|
@ -157,8 +157,8 @@ again:
|
|||
freeaddrinfo(ai);
|
||||
*addrcount = i;
|
||||
if (*addrcount == 0) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
return ISC_R_NOTFOUND;
|
||||
} else {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target) {
|
|||
result = dns_iptable_create(mctx, &acl->iptable);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(mctx, acl, sizeof(*acl));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
acl->elements = NULL;
|
||||
|
|
@ -77,7 +77,7 @@ dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target) {
|
|||
acl->port_proto_entries = 0;
|
||||
|
||||
*target = acl;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -93,17 +93,17 @@ dns_acl_anyornone(isc_mem_t *mctx, bool neg, dns_acl_t **target) {
|
|||
|
||||
result = dns_acl_create(mctx, 0, &acl);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = dns_iptable_addprefix(acl->iptable, NULL, 0, !neg);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_acl_detach(&acl);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
*target = acl;
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -111,7 +111,7 @@ dns_acl_anyornone(isc_mem_t *mctx, bool neg, dns_acl_t **target) {
|
|||
*/
|
||||
isc_result_t
|
||||
dns_acl_any(isc_mem_t *mctx, dns_acl_t **target) {
|
||||
return (dns_acl_anyornone(mctx, false, target));
|
||||
return dns_acl_anyornone(mctx, false, target);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -119,7 +119,7 @@ dns_acl_any(isc_mem_t *mctx, dns_acl_t **target) {
|
|||
*/
|
||||
isc_result_t
|
||||
dns_acl_none(isc_mem_t *mctx, dns_acl_t **target) {
|
||||
return (dns_acl_anyornone(mctx, true, target));
|
||||
return dns_acl_anyornone(mctx, true, target);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -133,11 +133,11 @@ dns_acl_isanyornone(dns_acl_t *acl, bool pos) {
|
|||
acl->iptable->radix == NULL || acl->iptable->radix->head == NULL ||
|
||||
acl->iptable->radix->head->prefix == NULL)
|
||||
{
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (acl->length != 0 || dns_acl_node_count(acl) != 1) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (acl->iptable->radix->head->prefix->bitlen == 0 &&
|
||||
|
|
@ -146,10 +146,10 @@ dns_acl_isanyornone(dns_acl_t *acl, bool pos) {
|
|||
acl->iptable->radix->head->data[1] &&
|
||||
*(bool *)(acl->iptable->radix->head->data[0]) == pos)
|
||||
{
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return (false); /* All others */
|
||||
return false; /* All others */
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -157,7 +157,7 @@ dns_acl_isanyornone(dns_acl_t *acl, bool pos) {
|
|||
*/
|
||||
bool
|
||||
dns_acl_isany(dns_acl_t *acl) {
|
||||
return (dns_acl_isanyornone(acl, true));
|
||||
return dns_acl_isanyornone(acl, true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -165,7 +165,7 @@ dns_acl_isany(dns_acl_t *acl) {
|
|||
*/
|
||||
bool
|
||||
dns_acl_isnone(dns_acl_t *acl) {
|
||||
return (dns_acl_isanyornone(acl, false));
|
||||
return dns_acl_isanyornone(acl, false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -243,7 +243,7 @@ dns_acl_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
|
|||
}
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -288,10 +288,10 @@ dns_acl_match_port_transport(const isc_netaddr_t *reqaddr,
|
|||
}
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
return (dns_acl_match(reqaddr, reqsigner, acl, env, match, matchelt));
|
||||
return dns_acl_match(reqaddr, reqsigner, acl, env, match, matchelt);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -394,7 +394,7 @@ dns_acl_merge(dns_acl_t *dest, dns_acl_t *source, bool pos) {
|
|||
nodes = max_node + dns_acl_node_count(dest);
|
||||
result = dns_iptable_merge(dest->iptable, source->iptable, pos);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
if (nodes > dns_acl_node_count(dest)) {
|
||||
dns_acl_node_count(dest) = nodes;
|
||||
|
|
@ -405,7 +405,7 @@ dns_acl_merge(dns_acl_t *dest, dns_acl_t *source, bool pos) {
|
|||
*/
|
||||
dns_acl_merge_ports_transports(dest, source, pos);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -433,9 +433,9 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
|
|||
if (matchelt != NULL) {
|
||||
*matchelt = e;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
} else {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
case dns_aclelementtype_nestedacl:
|
||||
|
|
@ -444,12 +444,12 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
|
|||
|
||||
case dns_aclelementtype_localhost:
|
||||
if (env == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
RWLOCK(&env->rwlock, isc_rwlocktype_read);
|
||||
if (env->localhost == NULL) {
|
||||
RWUNLOCK(&env->rwlock, isc_rwlocktype_read);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
dns_acl_attach(env->localhost, &inner);
|
||||
RWUNLOCK(&env->rwlock, isc_rwlocktype_read);
|
||||
|
|
@ -457,12 +457,12 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
|
|||
|
||||
case dns_aclelementtype_localnets:
|
||||
if (env == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
RWLOCK(&env->rwlock, isc_rwlocktype_read);
|
||||
if (env->localnets == NULL) {
|
||||
RWUNLOCK(&env->rwlock, isc_rwlocktype_read);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
dns_acl_attach(env->localnets, &inner);
|
||||
RWUNLOCK(&env->rwlock, isc_rwlocktype_read);
|
||||
|
|
@ -471,9 +471,9 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
|
|||
#if defined(HAVE_GEOIP2)
|
||||
case dns_aclelementtype_geoip:
|
||||
if (env == NULL || env->geoip == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
return (dns_geoip_match(reqaddr, env->geoip, &e->geoip_elem));
|
||||
return dns_geoip_match(reqaddr, env->geoip, &e->geoip_elem);
|
||||
#endif /* if defined(HAVE_GEOIP2) */
|
||||
default:
|
||||
UNREACHABLE();
|
||||
|
|
@ -495,7 +495,7 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
|
|||
if (matchelt != NULL) {
|
||||
*matchelt = e;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -506,7 +506,7 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
|
|||
*matchelt = NULL;
|
||||
}
|
||||
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -641,7 +641,7 @@ dns_acl_isinsecure(const dns_acl_t *a) {
|
|||
insecure = insecure_prefix_found;
|
||||
UNLOCK(&insecure_prefix_lock);
|
||||
if (insecure) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Now check non-radix elements */
|
||||
|
|
@ -660,7 +660,7 @@ dns_acl_isinsecure(const dns_acl_t *a) {
|
|||
|
||||
case dns_aclelementtype_nestedacl:
|
||||
if (dns_acl_isinsecure(e->nestedacl)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
continue;
|
||||
|
||||
|
|
@ -668,7 +668,7 @@ dns_acl_isinsecure(const dns_acl_t *a) {
|
|||
case dns_aclelementtype_geoip:
|
||||
#endif /* if defined(HAVE_GEOIP2) */
|
||||
case dns_aclelementtype_localnets:
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
|
|
@ -676,7 +676,7 @@ dns_acl_isinsecure(const dns_acl_t *a) {
|
|||
}
|
||||
|
||||
/* No insecure elements were found. */
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -689,13 +689,13 @@ dns_acl_allowed(isc_netaddr_t *addr, const dns_name_t *signer, dns_acl_t *acl,
|
|||
isc_result_t result;
|
||||
|
||||
if (acl == NULL) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
result = dns_acl_match(addr, signer, acl, aclenv, &match, NULL);
|
||||
if (result == ISC_R_SUCCESS && match > 0) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -728,14 +728,14 @@ dns_aclenv_create(isc_mem_t *mctx, dns_aclenv_t **envp) {
|
|||
|
||||
*envp = env;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup_localhost:
|
||||
dns_acl_detach(&env->localhost);
|
||||
cleanup_rwlock:
|
||||
isc_rwlock_destroy(&env->rwlock);
|
||||
isc_mem_putanddetach(&env->mctx, env, sizeof(*env));
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
114
lib/dns/adb.c
114
lib/dns/adb.c
|
|
@ -564,7 +564,7 @@ ttlclamp(dns_ttl_t ttl) {
|
|||
ttl = ADB_CACHE_MAXIMUM;
|
||||
}
|
||||
|
||||
return (ttl);
|
||||
return ttl;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1032,10 +1032,10 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset,
|
|||
* Lie a little here. This is more or less so code that cares
|
||||
* can find out if any new information was added or not.
|
||||
*/
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1068,7 +1068,7 @@ kill_name(dns_adbname_t **n, isc_eventtype_t ev) {
|
|||
if (result) {
|
||||
result = dec_adb_irefcnt(adb);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1101,7 +1101,7 @@ kill_name(dns_adbname_t **n, isc_eventtype_t ev) {
|
|||
name->flags |= NAME_IS_DEAD;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1150,7 +1150,7 @@ check_expire_namehooks(dns_adbname_t *name, isc_stdtime_t now) {
|
|||
clean_target(adb, &name->target);
|
||||
name->expire_target = INT_MAX;
|
||||
}
|
||||
return (result4 || result6);
|
||||
return result4 || result6;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1187,7 +1187,7 @@ unlink_name(dns_adb_t *adb, dns_adbname_t *name) {
|
|||
if (adb->name_sd[bucket] && adb->name_refcnt[bucket] == 0) {
|
||||
result = true;
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1243,7 +1243,7 @@ unlink_entry(dns_adb_t *adb, dns_adbentry_t *entry) {
|
|||
if (adb->entry_sd[bucket] && adb->entry_refcnt[bucket] == 0) {
|
||||
result = true;
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1297,7 +1297,7 @@ shutdown_names(dns_adb_t *adb) {
|
|||
|
||||
UNLOCK(&adb->namelocks[bucket]);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1343,7 +1343,7 @@ shutdown_entries(dns_adb_t *adb) {
|
|||
|
||||
UNLOCK(&adb->entrylocks[bucket]);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1410,7 +1410,7 @@ clean_namehooks(dns_adb_t *adb, dns_adbnamehooklist_t *namehooks) {
|
|||
if (addr_bucket != DNS_ADB_INVALIDBUCKET) {
|
||||
UNLOCK(&adb->entrylocks[addr_bucket]);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1442,12 +1442,12 @@ set_target(dns_adb_t *adb, const dns_name_t *name, const dns_name_t *fname,
|
|||
*/
|
||||
result = dns_rdataset_first(rdataset);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
dns_rdataset_current(rdataset, &rdata);
|
||||
result = dns_rdata_tostruct(&rdata, &cname, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
dns_name_dup(&cname.cname, adb->mctx, target);
|
||||
dns_rdata_freestruct(&cname);
|
||||
|
|
@ -1462,12 +1462,12 @@ set_target(dns_adb_t *adb, const dns_name_t *name, const dns_name_t *fname,
|
|||
*/
|
||||
result = dns_rdataset_first(rdataset);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
dns_rdataset_current(rdataset, &rdata);
|
||||
result = dns_rdata_tostruct(&rdata, &dname, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
/*
|
||||
* Construct the new target name.
|
||||
|
|
@ -1479,12 +1479,12 @@ set_target(dns_adb_t *adb, const dns_name_t *name, const dns_name_t *fname,
|
|||
NULL);
|
||||
dns_rdata_freestruct(&dname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
dns_name_dup(new_target, adb->mctx, target);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1633,7 +1633,7 @@ dec_adb_irefcnt(dns_adb_t *adb) {
|
|||
result = true;
|
||||
}
|
||||
UNLOCK(&adb->reflock);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1697,7 +1697,7 @@ dec_entry_refcnt(dns_adb_t *adb, bool overmem, dns_adbentry_t *entry, bool lock,
|
|||
}
|
||||
|
||||
if (!destroy_entry) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
entry->lock_bucket = DNS_ADB_INVALIDBUCKET;
|
||||
|
|
@ -1707,7 +1707,7 @@ dec_entry_refcnt(dns_adb_t *adb, bool overmem, dns_adbentry_t *entry, bool lock,
|
|||
result = dec_adb_irefcnt(adb);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static dns_adbname_t *
|
||||
|
|
@ -1750,7 +1750,7 @@ new_adbname(dns_adb_t *adb, const dns_name_t *dnsname) {
|
|||
}
|
||||
UNLOCK(&adb->namescntlock);
|
||||
|
||||
return (name);
|
||||
return name;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1790,7 +1790,7 @@ new_adbnamehook(dns_adb_t *adb, dns_adbentry_t *entry) {
|
|||
nh->entry = entry;
|
||||
ISC_LINK_INIT(nh, plink);
|
||||
|
||||
return (nh);
|
||||
return nh;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1824,7 +1824,7 @@ new_adblameinfo(dns_adb_t *adb, const dns_name_t *qname,
|
|||
li->qtype = qtype;
|
||||
ISC_LINK_INIT(li, plink);
|
||||
|
||||
return (li);
|
||||
return li;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1886,7 +1886,7 @@ new_adbentry(dns_adb_t *adb) {
|
|||
}
|
||||
UNLOCK(&adb->entriescntlock);
|
||||
|
||||
return (e);
|
||||
return e;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1958,7 +1958,7 @@ new_adbfind(dns_adb_t *adb) {
|
|||
|
||||
inc_adb_irefcnt(adb);
|
||||
h->magic = DNS_ADBFIND_MAGIC;
|
||||
return (h);
|
||||
return h;
|
||||
}
|
||||
|
||||
static dns_adbfetch_t *
|
||||
|
|
@ -1974,7 +1974,7 @@ new_adbfetch(dns_adb_t *adb) {
|
|||
|
||||
f->magic = DNS_ADBFETCH_MAGIC;
|
||||
|
||||
return (f);
|
||||
return f;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -2014,7 +2014,7 @@ free_adbfind(dns_adb_t *adb, dns_adbfind_t **findp) {
|
|||
|
||||
isc_refcount_decrement(&adb->ahrefcnt);
|
||||
isc_mem_put(adb->mctx, find, sizeof(*find));
|
||||
return (dec_adb_irefcnt(adb));
|
||||
return dec_adb_irefcnt(adb);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2036,7 +2036,7 @@ new_adbaddrinfo(dns_adb_t *adb, dns_adbentry_t *entry, in_port_t port) {
|
|||
ai->entry = entry;
|
||||
ISC_LINK_INIT(ai, publink);
|
||||
|
||||
return (ai);
|
||||
return ai;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -2087,13 +2087,13 @@ find_name_and_lock(dns_adb_t *adb, const dns_name_t *name, unsigned int options,
|
|||
STARTATZONE_MATCHES(adbname, options) &&
|
||||
STATICSTUB_MATCHES(adbname, options))
|
||||
{
|
||||
return (adbname);
|
||||
return adbname;
|
||||
}
|
||||
}
|
||||
adbname = ISC_LIST_NEXT(adbname, plink);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2135,11 +2135,11 @@ find_entry_and_lock(dns_adb_t *adb, const isc_sockaddr_t *addr, int *bucketp,
|
|||
{
|
||||
ISC_LIST_UNLINK(adb->entries[bucket], entry, plink);
|
||||
ISC_LIST_PREPEND(adb->entries[bucket], entry, plink);
|
||||
return (entry);
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2155,7 +2155,7 @@ entry_is_lame(dns_adb_t *adb, dns_adbentry_t *entry, const dns_name_t *qname,
|
|||
|
||||
li = ISC_LIST_HEAD(entry->lameinfo);
|
||||
if (li == NULL) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
while (li != NULL) {
|
||||
next_li = ISC_LIST_NEXT(li, plink);
|
||||
|
|
@ -2183,7 +2183,7 @@ entry_is_lame(dns_adb_t *adb, dns_adbentry_t *entry, const dns_name_t *qname,
|
|||
li = next_li;
|
||||
}
|
||||
|
||||
return (is_bad);
|
||||
return is_bad;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -2324,19 +2324,19 @@ check_expire_name(dns_adbname_t **namep, isc_stdtime_t now) {
|
|||
name = *namep;
|
||||
|
||||
if (NAME_HAS_V4(name) || NAME_HAS_V6(name)) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
if (NAME_FETCH(name)) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
if (!EXPIRE_OK(name->expire_v4, now)) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
if (!EXPIRE_OK(name->expire_v6, now)) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
if (!EXPIRE_OK(name->expire_target, now)) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2349,7 +2349,7 @@ check_expire_name(dns_adbname_t **namep, isc_stdtime_t now) {
|
|||
* Our caller, or one of its callers, will be calling check_exit() at
|
||||
* some point, so we don't need to do it here.
|
||||
*/
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -2428,11 +2428,11 @@ check_expire_entry(dns_adb_t *adb, dns_adbentry_t **entryp, isc_stdtime_t now) {
|
|||
entry = *entryp;
|
||||
|
||||
if (entry->refcnt != 0) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (entry->expires == 0 || entry->expires > now) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2446,7 +2446,7 @@ check_expire_entry(dns_adb_t *adb, dns_adbentry_t **entryp, isc_stdtime_t now) {
|
|||
if (result) {
|
||||
dec_adb_irefcnt(adb);
|
||||
}
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2463,7 +2463,7 @@ cleanup_names(dns_adb_t *adb, int bucket, isc_stdtime_t now) {
|
|||
LOCK(&adb->namelocks[bucket]);
|
||||
if (adb->name_sd[bucket]) {
|
||||
UNLOCK(&adb->namelocks[bucket]);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
name = ISC_LIST_HEAD(adb->names[bucket]);
|
||||
|
|
@ -2477,7 +2477,7 @@ cleanup_names(dns_adb_t *adb, int bucket, isc_stdtime_t now) {
|
|||
name = next_name;
|
||||
}
|
||||
UNLOCK(&adb->namelocks[bucket]);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2499,7 +2499,7 @@ cleanup_entries(dns_adb_t *adb, int bucket, isc_stdtime_t now) {
|
|||
entry = next_entry;
|
||||
}
|
||||
UNLOCK(&adb->entrylocks[bucket]);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -2709,7 +2709,7 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
|
|||
*/
|
||||
adb->magic = DNS_ADB_MAGIC;
|
||||
*newadb = adb;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
fail2:
|
||||
if (adb->task != NULL) {
|
||||
|
|
@ -2773,7 +2773,7 @@ fail2:
|
|||
}
|
||||
isc_mem_putanddetach(&adb->mctx, adb, sizeof(dns_adb_t));
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2936,7 +2936,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
|||
DP(DEF_LEVEL, "dns_adb_createfind: returning "
|
||||
"ISC_R_SHUTTINGDOWN");
|
||||
|
||||
return (ISC_R_SHUTTINGDOWN);
|
||||
return ISC_R_SHUTTINGDOWN;
|
||||
}
|
||||
|
||||
if (now == 0) {
|
||||
|
|
@ -3271,7 +3271,7 @@ out:
|
|||
}
|
||||
|
||||
UNLOCK(&adb->namelocks[bucket]);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -3862,7 +3862,7 @@ dbfind_name(dns_adbname_t *adbname, isc_stdtime_t now, dns_rdatatype_t rdtype) {
|
|||
dns_rdataset_disassociate(&rdataset);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -4130,7 +4130,7 @@ cleanup:
|
|||
dns_rdataset_disassociate(&rdataset);
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -4170,7 +4170,7 @@ dns_adb_marklame(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
|
|||
unlock:
|
||||
UNLOCK(&adb->entrylocks[bucket]);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -4453,7 +4453,7 @@ dns_adb_getudpsize(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
|
|||
size = addr->entry->udpsize;
|
||||
UNLOCK(&adb->entrylocks[bucket]);
|
||||
|
||||
return (size);
|
||||
return size;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -4507,7 +4507,7 @@ dns_adb_getcookie(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
|
|||
}
|
||||
UNLOCK(&adb->entrylocks[bucket]);
|
||||
|
||||
return (len);
|
||||
return len;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -4552,7 +4552,7 @@ dns_adb_findaddrinfo(dns_adb_t *adb, const isc_sockaddr_t *sa,
|
|||
unlock:
|
||||
UNLOCK(&adb->entrylocks[bucket]);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -4734,7 +4734,7 @@ dns_adbentry_overquota(dns_adbentry_t *entry) {
|
|||
uint_fast32_t quota = atomic_load_relaxed(&entry->quota);
|
||||
uint_fast32_t active = atomic_load_acquire(&entry->active);
|
||||
|
||||
return (quota != 0 && active >= quota);
|
||||
return quota != 0 && active >= quota;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ dns_badcache_init(isc_mem_t *mctx, unsigned int size, dns_badcache_t **bcp) {
|
|||
bc->magic = BADCACHE_MAGIC;
|
||||
|
||||
*bcp = bc;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -362,7 +362,7 @@ skip:
|
|||
}
|
||||
|
||||
RWUNLOCK(&bc->lock, isc_rwlocktype_read);
|
||||
return (answer);
|
||||
return answer;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -80,13 +80,13 @@ dns_byaddr_createptrname(const isc_netaddr_t *address, unsigned int options,
|
|||
remaining = sizeof(textname) - (cp - textname);
|
||||
strlcpy(cp, "ip6.arpa.", remaining);
|
||||
} else {
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
len = (unsigned int)strlen(textname);
|
||||
isc_buffer_init(&buffer, textname, len);
|
||||
isc_buffer_add(&buffer, len);
|
||||
return (dns_name_fromtext(name, &buffer, dns_rootname, 0, NULL));
|
||||
return dns_name_fromtext(name, &buffer, dns_rootname, 0, NULL);
|
||||
}
|
||||
|
||||
struct dns_byaddr {
|
||||
|
|
@ -124,7 +124,7 @@ copy_ptr_targets(dns_byaddr_t *byaddr, dns_rdataset_t *rdataset) {
|
|||
dns_rdataset_current(rdataset, &rdata);
|
||||
result = dns_rdata_tostruct(&rdata, &ptr, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
name = isc_mem_get(byaddr->mctx, sizeof(*name));
|
||||
dns_name_init(name, NULL);
|
||||
|
|
@ -138,7 +138,7 @@ copy_ptr_targets(dns_byaddr_t *byaddr, dns_rdataset_t *rdataset) {
|
|||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -232,7 +232,7 @@ dns_byaddr_create(isc_mem_t *mctx, const isc_netaddr_t *address,
|
|||
|
||||
*byaddrp = byaddr;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup_lock:
|
||||
isc_mutex_destroy(&byaddr->lock);
|
||||
|
|
@ -245,7 +245,7 @@ cleanup_lock:
|
|||
|
||||
isc_mem_putanddetach(&mctx, byaddr, sizeof(*byaddr));
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ cache_create_db(dns_cache_t *cache, dns_db_t **dbp, isc_mem_t **tmctxp,
|
|||
*dbp = db;
|
||||
*tmctxp = tmctx;
|
||||
*hmctxp = hmctx;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
result = isc_task_create(cache->taskmgr, 1, &dbtask);
|
||||
|
|
@ -243,7 +243,7 @@ cache_create_db(dns_cache_t *cache, dns_db_t **dbp, isc_mem_t **tmctxp,
|
|||
*tmctxp = tmctx;
|
||||
*hmctxp = hmctx;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup_dbtask:
|
||||
isc_task_detach(&dbtask);
|
||||
|
|
@ -253,7 +253,7 @@ cleanup_mctx:
|
|||
isc_mem_detach(&tmctx);
|
||||
isc_mem_detach(&hmctx);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -428,11 +428,11 @@ dns_cache_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
|
|||
}
|
||||
|
||||
*cachep = cache;
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
cache_free(cache);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -483,7 +483,7 @@ const char *
|
|||
dns_cache_getname(dns_cache_t *cache) {
|
||||
REQUIRE(VALID_CACHE(cache));
|
||||
|
||||
return (cache->name);
|
||||
return cache->name;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -546,7 +546,7 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr,
|
|||
overmem_cleaning_action, cleaner, sizeof(isc_event_t));
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
if (cleaner->overmem_event != NULL) {
|
||||
|
|
@ -563,7 +563,7 @@ cleanup:
|
|||
}
|
||||
isc_mutex_destroy(&cleaner->lock);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -819,7 +819,7 @@ dns_cache_clean(dns_cache_t *cache, isc_stdtime_t now) {
|
|||
|
||||
result = dns_db_createiterator(cache->db, 0, &iterator);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = dns_dbiterator_first(iterator);
|
||||
|
|
@ -859,7 +859,7 @@ dns_cache_clean(dns_cache_t *cache, isc_stdtime_t now) {
|
|||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -924,7 +924,7 @@ dns_cache_getcachesize(dns_cache_t *cache) {
|
|||
size = cache->size;
|
||||
UNLOCK(&cache->lock);
|
||||
|
||||
return (size);
|
||||
return size;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -950,7 +950,7 @@ dns_cache_getservestalettl(dns_cache_t *cache) {
|
|||
* to confirm the value that the db is really using.
|
||||
*/
|
||||
result = dns_db_getservestalettl(cache->db, &ttl);
|
||||
return (result == ISC_R_SUCCESS ? ttl : 0);
|
||||
return result == ISC_R_SUCCESS ? ttl : 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -972,7 +972,7 @@ dns_cache_getservestalerefresh(dns_cache_t *cache) {
|
|||
REQUIRE(VALID_CACHE(cache));
|
||||
|
||||
result = dns_db_getservestalerefresh(cache->db, &interval);
|
||||
return (result == ISC_R_SUCCESS ? interval : 0);
|
||||
return result == ISC_R_SUCCESS ? interval : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1011,7 +1011,7 @@ dns_cache_flush(dns_cache_t *cache) {
|
|||
|
||||
result = cache_create_db(cache, &db, &tmctx, &hmctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = dns_db_createiterator(db, false, &dbiterator);
|
||||
|
|
@ -1019,7 +1019,7 @@ dns_cache_flush(dns_cache_t *cache) {
|
|||
dns_db_detach(&db);
|
||||
isc_mem_detach(&tmctx);
|
||||
isc_mem_detach(&hmctx);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
LOCK(&cache->lock);
|
||||
|
|
@ -1056,7 +1056,7 @@ dns_cache_flush(dns_cache_t *cache) {
|
|||
isc_mem_detach(&oldhmctx);
|
||||
isc_mem_detach(&oldtmctx);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1067,7 +1067,7 @@ clearnode(dns_db_t *db, dns_dbnode_t *node) {
|
|||
result = dns_db_allrdatasets(db, node, NULL, DNS_DB_STALEOK,
|
||||
(isc_stdtime_t)0, &iter);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
for (result = dns_rdatasetiter_first(iter); result == ISC_R_SUCCESS;
|
||||
|
|
@ -1090,7 +1090,7 @@ clearnode(dns_db_t *db, dns_dbnode_t *node) {
|
|||
}
|
||||
|
||||
dns_rdatasetiter_destroy(&iter);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -1165,12 +1165,12 @@ cleanup:
|
|||
dns_db_detachnode(db, &top);
|
||||
}
|
||||
|
||||
return (answer);
|
||||
return answer;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_cache_flushname(dns_cache_t *cache, const dns_name_t *name) {
|
||||
return (dns_cache_flushnode(cache, name, false));
|
||||
return dns_cache_flushnode(cache, name, false);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -1180,7 +1180,7 @@ dns_cache_flushnode(dns_cache_t *cache, const dns_name_t *name, bool tree) {
|
|||
dns_db_t *db = NULL;
|
||||
|
||||
if (tree && dns_name_equal(name, dns_rootname)) {
|
||||
return (dns_cache_flush(cache));
|
||||
return dns_cache_flush(cache);
|
||||
}
|
||||
|
||||
LOCK(&cache->lock);
|
||||
|
|
@ -1189,7 +1189,7 @@ dns_cache_flushnode(dns_cache_t *cache, const dns_name_t *name, bool tree) {
|
|||
}
|
||||
UNLOCK(&cache->lock);
|
||||
if (db == NULL) {
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (tree) {
|
||||
|
|
@ -1209,13 +1209,13 @@ dns_cache_flushnode(dns_cache_t *cache, const dns_name_t *name, bool tree) {
|
|||
|
||||
cleanup_db:
|
||||
dns_db_detach(&db);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_stats_t *
|
||||
dns_cache_getstats(dns_cache_t *cache) {
|
||||
REQUIRE(VALID_CACHE(cache));
|
||||
return (cache->stats);
|
||||
return cache->stats;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1371,7 +1371,7 @@ renderstat(const char *name, uint64_t value, xmlTextWriterPtr writer) {
|
|||
TRY0(xmlTextWriterEndElement(writer)); /* counter */
|
||||
|
||||
error:
|
||||
return (xmlrc);
|
||||
return xmlrc;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -1414,7 +1414,7 @@ dns_cache_renderxml(dns_cache_t *cache, void *writer0) {
|
|||
TRY0(renderstat("HeapMemInUse", isc_mem_inuse(cache->hmctx), writer));
|
||||
TRY0(renderstat("HeapMemMax", isc_mem_maxinuse(cache->hmctx), writer));
|
||||
error:
|
||||
return (xmlrc);
|
||||
return xmlrc;
|
||||
}
|
||||
#endif /* ifdef HAVE_LIBXML2 */
|
||||
|
||||
|
|
@ -1508,6 +1508,6 @@ dns_cache_renderjson(dns_cache_t *cache, void *cstats0) {
|
|||
|
||||
result = ISC_R_SUCCESS;
|
||||
error:
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
#endif /* ifdef HAVE_JSON_C */
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue