Remove redundant parentheses from the return statement

(cherry picked from commit 0258850f20)
This commit is contained in:
Ondřej Surý 2024-11-19 10:38:03 +01:00
parent 2044a64d8b
commit 58a15d38c2
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41
451 changed files with 11483 additions and 11508 deletions

View file

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

View file

@ -86,10 +86,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
@ -97,10 +97,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;
}
}
}
@ -116,7 +116,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);
@ -125,7 +125,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))
@ -139,7 +139,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
continue;
}
*obj = cfg_tuple_get(value, "mode");
return (true);
return true;
}
}
}
@ -152,23 +152,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;
}
r.base = UNCONST(zclass);
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 */
@ -224,18 +224,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;
}
/*
@ -245,12 +245,12 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
if (dbobj != NULL &&
strcmp(ZONEDB_DEFAULT, 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);
@ -264,12 +264,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;
}
/*
@ -282,12 +282,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;
@ -465,7 +465,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 */
@ -500,7 +500,7 @@ configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
result = tresult;
}
}
return (result);
return result;
}
static isc_result_t
@ -510,11 +510,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;
}
r.base = UNCONST(cfg_obj_asstring(classobj));
r.length = strlen(r.base);
return (dns_rdataclass_fromtext(classp, &r));
return dns_rdataclass_fromtext(classp, &r);
}
/*% load zones from the configuration */
@ -572,7 +572,7 @@ load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
}
cleanup:
return (result);
return result;
}
static void
@ -769,5 +769,5 @@ cleanup:
isc_mem_destroy(&mctx);
}
return (result == ISC_R_SUCCESS ? 0 : 1);
return result == ISC_R_SUCCESS ? 0 : 1;
}

View file

@ -571,5 +571,5 @@ main(int argc, char **argv) {
}
isc_mem_destroy(&mctx);
return ((result == ISC_R_SUCCESS) ? 0 : 1);
return (result == ISC_R_SUCCESS) ? 0 : 1;
}

View file

@ -44,24 +44,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;
}
/*%
@ -71,19 +71,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;
}
}

View file

@ -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);
}

View file

@ -290,5 +290,5 @@ options {\n\
isc_mem_destroy(&mctx);
return (0);
return 0;
}

View file

@ -296,5 +296,5 @@ nsupdate -k <keyfile>\n");
isc_mem_destroy(&mctx);
return (0);
return 0;
}

View file

@ -606,7 +606,7 @@ setup_style(void) {
48, 80, 8, splitwidth, mctx);
}
return (result);
return result;
}
static isc_result_t
@ -627,11 +627,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 name %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
@ -664,7 +664,7 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client, dns_view_t *toview) {
CHECK(convert_name(&fkeyname, &keyname, keynamestr));
if (!root_validation) {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
if (anchor_name) {
@ -672,11 +672,11 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client, dns_view_t *toview) {
}
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);
@ -829,7 +829,7 @@ cleanup:
result = ISC_R_FAILURE;
}
return (result);
return result;
}
static isc_result_t
@ -854,7 +854,7 @@ cleanup:
if (result == DST_R_NOCRYPTO) {
result = ISC_R_SUCCESS;
}
return (result);
return result;
}
static isc_result_t
@ -867,7 +867,7 @@ setup_dnsseckeys(dns_client_t *client, dns_view_t *toview) {
cfg_obj_t *bindkeys = NULL;
if (!root_validation) {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
if (trust_anchor == NULL) {
@ -934,7 +934,7 @@ cleanup:
delv_log(ISC_LOG_ERROR, "setup_dnsseckeys: %s",
isc_result_totext(result));
}
return (result);
return result;
}
static isc_result_t
@ -981,7 +981,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;
@ -1017,7 +1017,7 @@ cleanup:
isc_result_totext(result));
}
return (result);
return result;
}
static isc_result_t
@ -1086,7 +1086,7 @@ cleanup:
if (resconf != NULL) {
irs_resconf_destroy(&resconf);
}
return (result);
return result;
}
static isc_result_t
@ -1099,10 +1099,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
@ -1482,7 +1482,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];
@ -1499,7 +1499,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) {
@ -1536,7 +1536,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");
@ -1554,28 +1554,28 @@ 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;
result = parse_uint(&destport, port, 0xffff, "port");
if (result != ISC_R_SUCCESS) {
fatal("Couldn't parse port number");
}
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;
@ -1596,7 +1596,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) {
@ -1614,14 +1614,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;
}
/*
@ -1788,11 +1788,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
@ -1803,17 +1803,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
@ -1832,10 +1832,10 @@ get_reverse(char *reverse, size_t len, char *value, bool strict) {
name = dns_fixedname_initname(&fname);
result = dns_byaddr_createptrname(&addr, 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.
@ -1848,17 +1848,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;
}
}
@ -2095,7 +2095,7 @@ accept_cb(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
UNUSED(handle);
UNUSED(arg);
return (result);
return result;
}
static void
@ -2170,7 +2170,7 @@ matchview(isc_netaddr_t *srcaddr, isc_netaddr_t *destaddr,
*viewp = view;
*viewpatchresultp = ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static void
@ -2310,5 +2310,5 @@ cleanup:
isc_managers_destroy(&mctx, &loopmgr, &netmgr);
return (0);
return 0;
}

View file

@ -89,9 +89,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 */
@ -473,7 +473,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, " ");
}
@ -494,7 +494,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) {
@ -511,7 +511,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;
}
/*%
@ -535,14 +535,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;
@ -550,15 +550,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;
}
/*%
@ -578,9 +578,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 (;;) {
@ -595,7 +595,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);
@ -606,11 +606,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
@ -628,10 +628,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;
}
/*
@ -1024,7 +1024,7 @@ repopulate_buffer:
dig_idnsetup(query->lookup, false);
return (result);
return result;
}
/*%
@ -1193,7 +1193,7 @@ proxy_handle_addr_string(const char *addr_start, const size_t addr_len,
}
}
return (result);
return result;
}
static bool
@ -1213,7 +1213,7 @@ parse_proxy_addresses(const char *addrs, isc_sockaddr_t *psrc,
/* start syntax analysis and verification */
if (!rule_proxy_addrs(&st)) {
warn("PROXY source and destination addresses cannot be parsed");
return (false);
return false;
}
/* get port numeric values */
@ -1240,7 +1240,7 @@ parse_proxy_addresses(const char *addrs, isc_sockaddr_t *psrc,
if (result != ISC_R_SUCCESS) {
warn("Cannot get PROXY source address: %s",
isc_result_totext(result));
return (false);
return false;
}
result = proxy_handle_addr_string(st.dst_addr_start, st.dst_addr_len,
@ -1248,26 +1248,26 @@ parse_proxy_addresses(const char *addrs, isc_sockaddr_t *psrc,
if (result != ISC_R_SUCCESS) {
warn("Cannot get PROXY destination address: %s",
isc_result_totext(result));
return (false);
return false;
}
/* addresses should be of the same type */
if (isc_sockaddr_pf(&src) != isc_sockaddr_pf(&dst)) {
warn("PROXY source and destination addresses must be of the "
"same type");
return (false);
return false;
}
*psrc = src;
*pdst = dst;
return (true);
return true;
}
static bool
rule_proxy_addrs(isc_proxy_addrs_parser_state_t *st) {
if (!rule_addr(st)) {
return (false);
return false;
}
st->src_addr_start = st->last_addr_start;
@ -1276,13 +1276,13 @@ rule_proxy_addrs(isc_proxy_addrs_parser_state_t *st) {
st->src_port_len = st->last_port_len;
if (!MATCH('-')) {
return (false);
return false;
}
ADVANCE();
if (!rule_addr(st)) {
return (false);
return false;
}
st->dst_addr_start = st->last_addr_start;
@ -1291,17 +1291,17 @@ rule_proxy_addrs(isc_proxy_addrs_parser_state_t *st) {
st->dst_port_len = st->last_port_len;
if (!MATCH('\0')) {
return (false);
return false;
}
return (true);
return true;
}
static bool
rule_addr(isc_proxy_addrs_parser_state_t *st) {
const char *start = GETP();
if (!rule_addr_char(st)) {
return (false);
return false;
}
while (rule_addr_char(st)) {
@ -1315,18 +1315,18 @@ rule_addr(isc_proxy_addrs_parser_state_t *st) {
ADVANCE();
if (!rule_port(st)) {
return (false);
return false;
}
}
return (true);
return true;
}
static bool
rule_port(isc_proxy_addrs_parser_state_t *st) {
const char *start = GETP();
if (!MATCH_DIGIT()) {
return (false);
return false;
}
ADVANCE();
@ -1338,18 +1338,18 @@ rule_port(isc_proxy_addrs_parser_state_t *st) {
st->last_port_start = start;
st->last_port_len = GETP() - start;
return (true);
return true;
}
static bool
rule_addr_char(isc_proxy_addrs_parser_state_t *st) {
if (MATCH('#') || MATCH('-') || MATCH('\0')) {
return (false);
return false;
}
ADVANCE();
return (true);
return true;
}
#undef GETP
@ -1366,20 +1366,20 @@ plus_proxy_handle_addresses(const char *value, const bool state,
* We are not interested in the option value in that
* case
*/
return (true);
return true;
}
if (value == NULL || *value == '\0') {
lookup->proxy_local = true;
return (true);
return true;
}
if (!parse_proxy_addresses(value, &lookup->proxy_src_addr,
&lookup->proxy_dst_addr))
{
return (false);
return false;
}
return (true);
return true;
}
static bool
@ -1402,10 +1402,10 @@ plus_proxy_options(const char *cmd, const char *value, const bool state,
default:
goto invalid_option;
}
return (true);
return true;
invalid_option:
return (false);
return false;
}
static bool
@ -1500,9 +1500,9 @@ plus_tls_options(const char *cmd, const char *value, const bool state,
goto invalid_option;
}
return (true);
return true;
invalid_option:
return (false);
return false;
}
/*%
@ -1525,7 +1525,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;
@ -2561,7 +2561,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:
@ -2607,7 +2607,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':
@ -2617,7 +2617,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':
@ -2626,7 +2626,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
cmd = option;
FULLCHECK("debug");
debugging = true;
return (false);
return false;
} else {
debugging = true;
}
@ -2657,7 +2657,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];
@ -2701,7 +2701,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");
@ -2720,13 +2720,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':
batchname = 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) {
@ -2734,7 +2734,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) {
@ -2753,7 +2753,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) {
@ -2811,7 +2811,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();
@ -2836,7 +2836,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);
@ -2866,14 +2866,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;
}
/*%
@ -2967,7 +2967,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
@ -3428,5 +3428,5 @@ main(int argc, char **argv) {
dig_startup();
dig_shutdown();
return (exitcode);
return exitcode;
}

View file

@ -236,7 +236,7 @@ count_dots(char *string) {
}
s++;
}
return (i);
return i;
}
static void
@ -284,11 +284,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
@ -299,17 +299,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
@ -328,10 +328,10 @@ get_reverse(char *reverse, size_t len, char *value, bool strict) {
name = dns_fixedname_initname(&fname);
result = dns_byaddr_createptrname(&addr, 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.
@ -344,18 +344,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;
}
}
@ -456,7 +456,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;
}
/*%
@ -632,7 +632,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
@ -823,7 +823,7 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
looknew->magic = DIG_LOOKUP_MAGIC;
return (looknew);
return looknew;
}
/*%
@ -853,7 +853,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
@ -914,20 +914,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
@ -940,7 +940,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
@ -1018,7 +1018,7 @@ done:
sa->length = prefix_length;
*sap = sa;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
/*
@ -1094,7 +1094,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);
@ -1135,7 +1135,7 @@ cleanup:
cfg_parser_destroy(&pctx);
}
return (result);
return result;
}
void
@ -1205,7 +1205,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
@ -1549,13 +1549,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
@ -1865,7 +1865,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;
@ -1968,7 +1968,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);
}
/*
@ -2000,7 +2000,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) {
link);
}
return (numLookups);
return numLookups;
}
/*%
@ -2027,7 +2027,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;
}
/*
@ -2039,14 +2039,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);
@ -2055,13 +2055,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;
}
/*%
@ -2164,7 +2164,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;
}
/*%
@ -2298,7 +2298,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,
@ -2325,7 +2325,7 @@ setup_lookup(dig_lookup_t *lookup) {
isc_result_totext(result));
#if TARGET_OS_IPHONE
clear_current_lookup();
return (false);
return false;
#else /* if TARGET_OS_IPHONE */
cleanup_openssl_refs();
digexit();
@ -2658,7 +2658,7 @@ setup_lookup(dig_lookup_t *lookup) {
ISC_LIST_ENQUEUE(lookup->q, query, link);
}
return (true);
return true;
}
/*%
@ -2803,7 +2803,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));
@ -2882,7 +2882,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) {
@ -2891,7 +2891,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);
@ -2906,7 +2906,7 @@ failure:
if (store != NULL && store != found_store) {
isc_tls_cert_store_free(&store);
}
return (NULL);
return NULL;
}
static void
@ -3360,12 +3360,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...");
@ -3376,7 +3376,7 @@ try_next_server(dig_lookup_t *lookup) {
start_udp(next_query);
}
return (true);
return true;
}
static void
@ -3715,7 +3715,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;
@ -3741,7 +3741,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))
@ -3821,10 +3821,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
@ -3918,7 +3918,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;
}
/*%
@ -4132,8 +4132,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",
@ -4589,12 +4588,12 @@ get_address(char *host, in_port_t myport, isc_sockaddr_t *sockaddr) {
result = isc_getaddresses(host, myport, sockaddr, 1, &count);
isc_loopmgr_nonblocking(loopmgr);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
INSIST(count == 1);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
int
@ -4616,7 +4615,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++) {
@ -4626,7 +4625,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;
}
/*%
@ -4808,7 +4807,7 @@ idn_filter(isc_buffer_t *buffer, unsigned int start) {
}
resetlocale(LC_ALL);
if (res != IDN2_OK) {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
/*
@ -4816,14 +4815,14 @@ idn_filter(isc_buffer_t *buffer, unsigned int start) {
*/
dstlen = strlen(dst);
if (isc_buffer_length(buffer) < start + dstlen) {
return (ISC_R_NOSPACE);
return ISC_R_NOSPACE;
}
isc_buffer_subtract(buffer, srclen);
memmove(isc_buffer_used(buffer), dst, dstlen);
isc_buffer_add(buffer, dstlen);
idn2_free(dst);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
/*%
@ -4889,8 +4888,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;
}

View file

@ -96,7 +96,7 @@ rcode_totext(dns_rcode_t rcode) {
} else {
totext.consttext = rcodetext[rcode];
}
return (totext.deconsttext);
return totext.deconsttext;
}
noreturn static void
@ -222,9 +222,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 (;;) {
@ -262,7 +262,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) {
@ -317,11 +317,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
@ -341,12 +341,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
@ -423,7 +423,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) {
@ -517,7 +517,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])) {
@ -527,7 +527,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;
}
}
@ -538,7 +538,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]) &&
@ -548,7 +548,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) {
@ -556,7 +556,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) {
@ -574,7 +574,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:";
@ -917,5 +917,5 @@ main(int argc, char **argv) {
cancel_all();
destroy_libs();
return ((seen_error == 0) ? 0 : 1);
return (seen_error == 0) ? 0 : 1;
}

View file

@ -128,7 +128,7 @@ rcode_totext(dns_rcode_t rcode) {
} else {
totext.consttext = rcodetext[rcode];
}
return (totext.deconsttext);
return totext.deconsttext;
}
static void
@ -210,9 +210,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;
@ -256,10 +256,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
@ -294,9 +294,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;
@ -338,10 +338,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
@ -424,7 +424,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) {
@ -478,7 +478,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
@ -537,10 +537,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;
}
}
@ -554,10 +554,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;
}
}
@ -975,5 +975,5 @@ main(int argc, char **argv) {
cancel_all();
destroy_libs();
return (query_error | print_error);
return query_error | print_error;
}

View file

@ -48,9 +48,9 @@ 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)

View file

@ -395,7 +395,7 @@ formatset(dns_rdataset_t *rdataset) {
}
isc_buffer_putuint8(buf, 0);
return (buf);
return buf;
}
static void
@ -505,14 +505,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;
}
}
@ -521,7 +521,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;
}
/*
@ -575,7 +575,7 @@ match_keyset_dsset(dns_rdataset_t *keyset, dns_rdataset_t *dsset,
}
}
return (keytable);
return keytable;
}
static void
@ -681,7 +681,7 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
}
}
return (algo);
return algo;
}
/*
@ -698,7 +698,7 @@ signed_loose(dns_secalg_t *algo) {
}
}
isc_mem_cput(mctx, algo, nkey, sizeof(algo[0]));
return (ok);
return ok;
}
/*
@ -740,7 +740,7 @@ signed_strict(dns_rdataset_t *dsset, dns_secalg_t *algo) {
}
isc_mem_cput(mctx, algo, nkey, sizeof(algo[0]));
return (all_ok);
return all_ok;
}
/*
@ -761,10 +761,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
@ -777,7 +777,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);
@ -785,7 +785,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
@ -816,14 +816,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
@ -868,8 +868,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);
}
/*
@ -950,7 +950,7 @@ consistent_digests(dns_rdataset_t *dsset) {
isc_mem_cput(mctx, ds, n, sizeof(dns_rdata_ds_t));
isc_mem_cput(mctx, arrdata, n, sizeof(dns_rdata_t));
return (match);
return match;
}
static void
@ -1355,5 +1355,5 @@ cleanup:
print_mem_stats = true;
cleanup();
return (0);
return 0;
}

View file

@ -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
@ -558,8 +558,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;
}
}

View file

@ -68,7 +68,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
@ -141,7 +141,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
if (db != NULL) {
dns_db_detach(&db);
}
return (result);
return result;
}
static void
@ -468,8 +468,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;
}
}

View file

@ -761,5 +761,5 @@ main(int argc, char **argv) {
free(freeit);
}
return (0);
return 0;
}

View file

@ -1333,5 +1333,5 @@ main(int argc, char **argv) {
free(freeit);
}
return (0);
return 0;
}

View file

@ -152,7 +152,7 @@ between(isc_stdtime_t t, isc_stdtime_t start, isc_stdtime_t end) {
if (t > 0 && t > start && t < end) {
r = t;
}
return (r);
return r;
}
static void
@ -203,15 +203,15 @@ keyalgtag_cmp(const void *k1, const void *k2) {
dns_dnsseckey_t **key1 = (dns_dnsseckey_t **)k1;
dns_dnsseckey_t **key2 = (dns_dnsseckey_t **)k2;
if (dst_key_alg((*key1)->key) < dst_key_alg((*key2)->key)) {
return (-1);
return -1;
} else if (dst_key_alg((*key1)->key) > dst_key_alg((*key2)->key)) {
return (1);
return 1;
} else if (dst_key_id((*key1)->key) < dst_key_id((*key2)->key)) {
return (-1);
return -1;
} else if (dst_key_id((*key1)->key) > dst_key_id((*key2)->key)) {
return (1);
return 1;
}
return (0);
return 0;
}
static void
@ -645,7 +645,7 @@ fail:
namestr, algstr, timestr);
}
return (next_bundle);
return next_bundle;
}
static isc_stdtime_t
@ -739,7 +739,7 @@ sign_rrset(ksr_ctx_t *ksr, isc_stdtime_t inception, isc_stdtime_t expiration,
print_rdata(&rrsigset);
freerrset(&rrsigset);
return (next_bundle);
return next_bundle;
}
/*
@ -897,11 +897,11 @@ get_keymaterial(ksr_ctx_t *ksr, dns_kasp_t *kasp, isc_stdtime_t inception,
dns_rdatalist_tordataset(cdnskeylist, cdnskeyset);
dns_rdatalist_tordataset(cdslist, cdsset);
return (next_bundle);
return next_bundle;
fail:
fatal("failed to create KSK/CDS/CDNSKEY");
return (0);
return 0;
}
static void
@ -1012,10 +1012,10 @@ parse_dnskey(isc_lex_t *lex, char *owner, isc_buffer_t *buf, dns_ttl_t *ttl) {
isc_buffer_add(&b, strlen(owner));
ret = dns_name_fromtext(dname, &b, dns_rootname, 0, NULL);
if (ret != ISC_R_SUCCESS) {
return (ret);
return ret;
}
if (dns_name_compare(dname, name) != 0) {
return (DNS_R_BADOWNERNAME);
return DNS_R_BADOWNERNAME;
}
isc_buffer_clear(&b);
@ -1053,7 +1053,7 @@ parse_dnskey(isc_lex_t *lex, char *owner, isc_buffer_t *buf, dns_ttl_t *ttl) {
cleanup:
isc_lex_setcomments(lex, 0);
return (ret);
return ret;
}
static void

View file

@ -257,5 +257,5 @@ cleanup:
}
isc_mem_destroy(&mctx);
return (0);
return 0;
}

View file

@ -960,5 +960,5 @@ main(int argc, char **argv) {
isc_mem_free(mctx, directory);
isc_mem_destroy(&mctx);
return (0);
return 0;
}

View file

@ -197,7 +197,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
@ -326,28 +326,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;
}
/*%
@ -367,10 +367,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;
}
/*%
@ -387,7 +387,7 @@ keythatsigned(dns_rdata_rrsig_t *rrsig) {
key = keythatsigned_unlocked(rrsig);
RWUNLOCK(&keylist_lock, isc_rwlocktype_read);
if (key != NULL) {
return (key);
return key;
}
/*
@ -401,7 +401,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,
@ -409,7 +409,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(
@ -428,7 +428,7 @@ keythatsigned(dns_rdata_rrsig_t *rrsig) {
ISC_LIST_APPEND(keylist, key, link);
isc_rwlock_unlock(&keylist_lock, isc_rwlocktype_write);
return (key);
return key;
}
/*%
@ -450,11 +450,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;
}
@ -462,7 +462,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
@ -472,10 +472,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;
}
}
@ -860,7 +860,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
@ -892,11 +892,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 *
@ -918,16 +918,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;
}
}
@ -1036,7 +1036,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);
@ -1045,13 +1045,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);
@ -1060,7 +1060,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");
@ -1097,7 +1097,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
@ -1106,7 +1106,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);
@ -1116,7 +1116,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
@ -1126,7 +1126,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);
@ -1139,7 +1139,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;
}
/*%
@ -1158,7 +1158,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;
}
/*%
@ -1376,7 +1376,7 @@ active_node(dns_dbnode_t *node) {
}
dns_rdatasetiter_destroy(&rdsiter);
return (active);
return active;
}
/*%
@ -1425,7 +1425,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);
@ -1499,7 +1499,7 @@ cleanup:
}
dns_rdata_reset(&rdata);
return (result);
return result;
}
/*%
@ -4157,5 +4157,5 @@ main(int argc, char *argv[]) {
}
isc_mutex_destroy(&namelock);
return (vresult == ISC_R_SUCCESS ? 0 : 1);
return vresult == ISC_R_SUCCESS ? 0 : 1;
}

View file

@ -342,5 +342,5 @@ main(int argc, char *argv[]) {
}
isc_mem_destroy(&mctx);
return (result == ISC_R_SUCCESS ? 0 : 1);
return result == ISC_R_SUCCESS ? 0 : 1;
}

View file

@ -202,16 +202,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",
@ -223,29 +223,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
@ -255,7 +255,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);
@ -263,19 +263,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,13 +292,13 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) {
if (isnone(str)) {
SET_IF_NOT_NULL(setp, false);
return ((isc_stdtime_t)0);
return (isc_stdtime_t)0;
}
SET_IF_NOT_NULL(setp, true);
if ((str[0] == '0' || str[0] == '-') && str[1] == '\0') {
return ((isc_stdtime_t)0);
return (isc_stdtime_t)0;
}
/*
@ -347,7 +347,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);
@ -360,7 +360,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
@ -370,7 +370,7 @@ strtoclass(const char *str) {
isc_result_t result;
if (str == NULL) {
return (dns_rdataclass_in);
return dns_rdataclass_in;
}
r.base = UNCONST(str);
r.length = strlen(str);
@ -378,7 +378,7 @@ strtoclass(const char *str) {
if (result != ISC_R_SUCCESS) {
fatal("unknown class %s", str);
}
return (rdclass);
return rdclass;
}
unsigned int
@ -393,14 +393,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
@ -432,7 +432,7 @@ try_dir(const char *dirname) {
if (result == ISC_R_SUCCESS) {
isc_dir_close(&d);
}
return (result);
return result;
}
/*
@ -501,14 +501,14 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
if (id < min || id > max) {
fprintf(stderr, "Key ID %d outside of [%u..%u]\n", id,
min, max);
return (true);
return true;
}
if (rid < min || rid > max) {
fprintf(stderr,
"Revoked Key ID %d (for tag %d) outside of "
"[%u..%u]\n",
rid, id, min, max);
return (true);
return true;
}
}
@ -516,7 +516,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
result = dns_dnssec_findmatchingkeys(name, NULL, dir, NULL, now, mctx,
&matchkeys);
if (result == ISC_R_NOTFOUND) {
return (false);
return false;
}
while (!ISC_LIST_EMPTY(matchkeys) && !conflict) {
@ -560,7 +560,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
dns_dnsseckey_destroy(mctx, &key);
}
return (conflict);
return conflict;
}
bool
@ -575,9 +575,9 @@ 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;
}
void

View file

@ -120,7 +120,7 @@ putrdata(bdbnode_t *node, dns_rdatatype_t typeval, dns_ttl_t ttl,
rdatalist->ttl = ttl;
ISC_LIST_APPEND(node->lists, rdatalist, link);
} else if (rdatalist->ttl != ttl) {
return (DNS_R_BADTTL);
return DNS_R_BADTTL;
}
rdata = isc_mem_get(mctx, sizeof(dns_rdata_t));
@ -136,7 +136,7 @@ putrdata(bdbnode_t *node, dns_rdatatype_t typeval, dns_ttl_t ttl,
ISC_LIST_APPEND(rdatalist->rdata, rdata, link);
ISC_LIST_APPEND(node->buffers, rdatabuf, link);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -159,7 +159,7 @@ putrr(bdbnode_t *node, const char *type, dns_ttl_t ttl, const char *data) {
isc_constregion_t r = { .base = type, .length = strlen(type) };
result = dns_rdatatype_fromtext(&typeval, (isc_textregion_t *)&r);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
isc_lex_create(mctx, 64, &lex);
@ -170,7 +170,7 @@ putrr(bdbnode_t *node, const char *type, dns_ttl_t ttl, const char *data) {
result = isc_lex_openbuffer(lex, &b);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
isc_buffer_allocate(mctx, &rb, DNS_RDATA_MAXLENGTH);
@ -185,7 +185,7 @@ putrr(bdbnode_t *node, const char *type, dns_ttl_t ttl, const char *data) {
isc_buffer_free(&rb);
return (result);
return result;
}
/* Reasonable default SOA values */
@ -207,9 +207,9 @@ putsoa(bdbnode_t *node, const char *mname, const char *rname, uint32_t serial) {
serial, DEFAULT_REFRESH, DEFAULT_RETRY, DEFAULT_EXPIRE,
DEFAULT_MINIMUM);
if (n >= (int)sizeof(str) || n < 0) {
return (ISC_R_NOSPACE);
return ISC_R_NOSPACE;
}
return (putrr(node, "SOA", DEFAULT_TTL, str));
return putrr(node, "SOA", DEFAULT_TTL, str);
}
static isc_result_t
@ -222,7 +222,7 @@ puttxt(bdbnode_t *node, const char *text) {
}
buf[0] = len;
memmove(&buf[1], text, len);
return (putrdata(node, dns_rdatatype_txt, 0, buf, len + 1));
return putrdata(node, dns_rdatatype_txt, 0, buf, len + 1);
}
/*
@ -279,7 +279,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
@ -301,7 +301,7 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
zlen = zone->length;
nlen = name->length;
if ((zlen + nlen) > 74U || zlen < 10U || (nlen % 2) != 0U) {
return (ISC_R_NOTFOUND);
return ISC_R_NOTFOUND;
}
/*
@ -320,11 +320,11 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
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;
@ -346,14 +346,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
* 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;
@ -363,14 +363,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
* 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;
@ -380,14 +380,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
* 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;
@ -397,14 +397,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
* 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;
@ -414,14 +414,14 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
* 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;
@ -431,7 +431,7 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
* so return success.
*/
if (nlen + zlen != 74U) {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
len = dns64_rdata(v, 0, rdata);
break;
@ -440,7 +440,7 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
* 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;
}
/*
@ -449,22 +449,22 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
if ((v[0] == 170 || v[0] == 171) && v[1] == 0 && v[2] == 0 &&
v[3] == 192)
{
return (putrdata(node, dns_rdatatype_ptr, 3600, ipv4only,
sizeof(ipv4only)));
return putrdata(node, dns_rdatatype_ptr, 3600, ipv4only,
sizeof(ipv4only));
}
return (putrdata(node, dns_rdatatype_cname, 600, rdata,
(unsigned int)len));
return putrdata(node, dns_rdatatype_cname, 600, rdata,
(unsigned int)len);
}
static isc_result_t
builtin_lookup(bdb_t *bdb, const dns_name_t *name, bdbnode_t *node) {
if (name->labels == 0 && name->length == 0) {
return (bdb->lookup(node));
return bdb->lookup(node);
} else if ((node->bdb->implementation->flags & BDB_DNS64) != 0) {
return (dns64_cname(&bdb->common.origin, name, node));
return dns64_cname(&bdb->common.origin, name, node);
} else {
return (ISC_R_NOTFOUND);
return ISC_R_NOTFOUND;
}
}
@ -483,27 +483,27 @@ builtin_authority(bdb_t *bdb, bdbnode_t *node) {
result = putsoa(node, server, contact, 0);
if (result != ISC_R_SUCCESS) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
result = putrr(node, "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
version_lookup(bdbnode_t *node) {
if (named_g_server->version_set) {
if (named_g_server->version == NULL) {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
} else {
return (puttxt(node, named_g_server->version));
return puttxt(node, named_g_server->version);
}
} else {
return (puttxt(node, PACKAGE_VERSION));
return puttxt(node, PACKAGE_VERSION);
}
}
@ -511,16 +511,16 @@ static isc_result_t
hostname_lookup(bdbnode_t *node) {
if (named_g_server->hostname_set) {
if (named_g_server->hostname == NULL) {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
} else {
return (puttxt(node, named_g_server->hostname));
return puttxt(node, named_g_server->hostname);
}
} else {
char buf[256];
if (gethostname(buf, sizeof(buf)) != 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
return (puttxt(node, buf));
return puttxt(node, buf);
}
}
@ -546,16 +546,16 @@ authors_lookup(bdbnode_t *node) {
* 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 = puttxt(node, *p);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
}
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -563,13 +563,13 @@ id_lookup(bdbnode_t *node) {
if (named_g_server->sctx->usehostname) {
char buf[256];
if (gethostname(buf, sizeof(buf)) != 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
return (puttxt(node, buf));
return puttxt(node, buf);
} else if (named_g_server->sctx->server_id != NULL) {
return (puttxt(node, named_g_server->sctx->server_id));
return puttxt(node, named_g_server->sctx->server_id);
} else {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
}
@ -577,7 +577,7 @@ static isc_result_t
empty_lookup(bdbnode_t *node) {
UNUSED(node);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -588,10 +588,10 @@ ipv4only_lookup(bdbnode_t *node) {
for (int i = 0; i < 2; i++) {
result = putrdata(node, 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
@ -600,7 +600,7 @@ ipv4reverse_lookup(bdbnode_t *node) {
result = putrdata(node, dns_rdatatype_ptr, 3600, ipv4only,
sizeof(ipv4only));
return (result);
return result;
}
/*
@ -670,10 +670,10 @@ rdatasetiter_first(dns_rdatasetiter_t *iterator DNS__DB_FLARG) {
bdbnode_t *bdbnode = (bdbnode_t *)iterator->node;
if (ISC_LIST_EMPTY(bdbnode->lists)) {
return (ISC_R_NOMORE);
return ISC_R_NOMORE;
}
bdbiterator->current = ISC_LIST_HEAD(bdbnode->lists);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -682,9 +682,9 @@ rdatasetiter_next(dns_rdatasetiter_t *iterator DNS__DB_FLARG) {
bdbiterator->current = ISC_LIST_NEXT(bdbiterator->current, link);
if (bdbiterator->current == NULL) {
return (ISC_R_NOMORE);
return ISC_R_NOMORE;
} else {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
}
@ -787,7 +787,7 @@ createnode(bdb_t *bdb, bdbnode_t **nodep) {
node->magic = BDBNODE_MAGIC;
*nodep = node;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static void
@ -844,23 +844,23 @@ getoriginnode(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG) {
result = createnode(bdb, &node);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
result = builtin_lookup(bdb, name, node);
if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND) {
destroynode(node);
return (result);
return result;
}
result = builtin_authority(bdb, node);
if (result != ISC_R_SUCCESS) {
destroynode(node);
return (result);
return result;
}
*nodep = node;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -887,26 +887,26 @@ findnode(dns_db_t *db, const dns_name_t *name, bool create,
result = createnode(bdb, &node);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
result = builtin_lookup(bdb, name, node);
if (result != ISC_R_SUCCESS && (!isorigin || result != ISC_R_NOTFOUND))
{
destroynode(node);
return (result);
return result;
}
if (isorigin) {
result = builtin_authority(bdb, node);
if (result != ISC_R_SUCCESS) {
destroynode(node);
return (result);
return result;
}
}
*nodep = node;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -928,7 +928,7 @@ find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
REQUIRE(version == NULL || version == (void *)&dummy);
if (!dns_name_issubdomain(name, &db->origin)) {
return (DNS_R_NXDOMAIN);
return DNS_R_NXDOMAIN;
}
olabels = dns_name_countlabels(&db->origin);
@ -954,13 +954,13 @@ find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
* No data at zone apex?
*/
if (i == olabels) {
return (DNS_R_BADDB);
return DNS_R_BADDB;
}
result = DNS_R_NXDOMAIN;
continue;
}
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
/*
@ -1069,7 +1069,7 @@ find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
detachnode(db, &node DNS__DB_FLARG_PASS);
}
return (result);
return result;
}
static void
@ -1117,7 +1117,7 @@ findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
UNUSED(sigrdataset);
if (type == dns_rdatatype_rrsig) {
return (ISC_R_NOTIMPLEMENTED);
return ISC_R_NOTIMPLEMENTED;
}
list = ISC_LIST_HEAD(bdbnode->lists);
@ -1128,12 +1128,12 @@ findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
list = ISC_LIST_NEXT(list, link);
}
if (list == NULL) {
return (ISC_R_NOTFOUND);
return ISC_R_NOTFOUND;
}
new_rdataset(list, db, node, rdataset);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -1158,7 +1158,7 @@ allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
*iteratorp = (dns_rdatasetiter_t *)iterator;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static dns_dbmethods_t bdb_methods = {
@ -1186,7 +1186,7 @@ create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
REQUIRE(implementation != NULL);
if (type != dns_dbtype_zone) {
return (ISC_R_NOTIMPLEMENTED);
return ISC_R_NOTIMPLEMENTED;
}
bdb = isc_mem_get(mctx, sizeof(*bdb));
@ -1241,7 +1241,7 @@ create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
*dbp = (dns_db_t *)bdb;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
cleanup:
dns_name_free(&bdb->common.origin, mctx);
@ -1253,7 +1253,7 @@ cleanup:
}
isc_mem_putanddetach(&bdb->common.mctx, bdb, sizeof(bdb_t));
return (result);
return result;
}
/*
@ -1269,17 +1269,17 @@ named_builtin_init(void) {
result = dns_db_register("_builtin", create, &builtin, named_g_mctx,
&builtin.dbimp);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
result = dns_db_register("_dns64", create, &dns64, named_g_mctx,
&dns64.dbimp);
if (result != ISC_R_SUCCESS) {
dns_db_unregister(&builtin.dbimp);
return (result);
return result;
}
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
void

View file

@ -358,15 +358,15 @@ 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 | CFG_PCTX_NOOBSOLETE |
CFG_PCTX_NOEXPERIMENTAL,
conf));
return cfg_parse_buffer(parser, &b, __FILE__, 0, &cfg_type_namedconf,
CFG_PCTX_NODEPRECATED | CFG_PCTX_NOOBSOLETE |
CFG_PCTX_NOEXPERIMENTAL,
conf);
}
const char *
named_config_getdefault(void) {
return (defaultconf);
return defaultconf;
}
isc_result_t
@ -376,10 +376,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
@ -405,7 +405,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))
@ -419,13 +419,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
@ -437,7 +437,7 @@ named_config_listcount(const cfg_obj_t *list) {
i++;
}
return (i);
return i;
}
isc_result_t
@ -448,7 +448,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;
}
r.base = UNCONST(cfg_obj_asstring(classobj));
r.length = strlen(r.base);
@ -457,7 +457,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
@ -468,7 +468,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;
}
r.base = UNCONST(cfg_obj_asstring(typeobj));
r.length = strlen(r.base);
@ -477,7 +477,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
@ -503,7 +503,7 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
} else {
UNREACHABLE();
}
return (ztype);
return ztype;
}
static isc_result_t
@ -519,7 +519,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) {
@ -528,11 +528,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
@ -541,15 +541,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
@ -564,7 +564,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));
@ -579,11 +579,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) \
@ -831,7 +831,7 @@ resume:
ipkl->count = addrcount;
ipkl->allocated = addrcount;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
cleanup:
if (addrs != NULL) {
@ -870,7 +870,7 @@ cleanup:
if (stack != NULL) {
isc_mem_cput(mctx, stack, stackcount, sizeof(stack[0]));
}
return (result);
return result;
}
isc_result_t
@ -896,10 +896,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 {
@ -943,15 +943,15 @@ named_config_getkeyalgorithm(const char *str, unsigned int *typep,
}
}
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;
@ -960,5 +960,5 @@ named_config_getkeyalgorithm(const char *str, unsigned int *typep,
}
SET_IF_NOT_NULL(typep, algorithms[i].type);
SET_IF_NOT_NULL(digestbits, bits);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}

View file

@ -43,23 +43,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;
}
/*%
@ -85,7 +85,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);
@ -93,7 +93,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
/*
* We have no idea what this is.
*/
return (result);
return result;
}
isc_lex_create(named_g_mctx, strlen(cmdline), &lex);
@ -301,5 +301,5 @@ cleanup:
isc_lex_destroy(&lex);
}
return (result);
return result;
}

View file

@ -246,7 +246,7 @@ address_ok(isc_sockaddr_t *sockaddr, controllistener_t *listener) {
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
@ -641,7 +641,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);
@ -652,11 +652,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
@ -710,11 +710,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
@ -838,7 +838,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));
@ -904,7 +904,7 @@ cleanup:
if (pctx != NULL) {
cfg_parser_destroy(&pctx);
}
return (result);
return result;
}
/*
@ -1212,7 +1212,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
ISC_LOG_ERROR,
"UNIX domain sockets are not "
"supported");
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
(void)cfg_map_get(controls, "inet", &inetcontrols);
@ -1341,7 +1341,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
@ -1364,10 +1364,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

View file

@ -98,13 +98,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
@ -116,13 +116,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
@ -134,13 +134,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
@ -155,7 +155,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
@ -172,7 +172,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;
}
/*
@ -195,7 +195,7 @@ dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
}
}
return (ptr);
return ptr;
}
static void
@ -219,7 +219,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);
@ -319,14 +319,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;
}
/*
@ -363,13 +363,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;
}
/*
@ -404,7 +404,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);
@ -413,7 +413,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;
}
/*
@ -429,7 +429,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);
@ -437,7 +437,7 @@ dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
keydata, cd->dbdata);
MAYBE_UNLOCK(cd);
return (ret);
return ret;
}
/*
@ -452,14 +452,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;
}
/*
@ -474,14 +474,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;
}
/*
@ -496,14 +496,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 = {
@ -535,7 +535,7 @@ dlz_dlopen_init(isc_mem_t *mctx) {
result = ISC_R_UNEXPECTED;
}
return (result);
return result;
}
/*

View file

@ -127,7 +127,7 @@ fuzz_thread_client(void *arg) {
named_server_flushonshutdown(named_g_server,
false);
isc_loopmgr_shutdown(named_g_loopmgr);
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_loopmgr_shutdown(named_g_loopmgr);
return (NULL);
return NULL;
}
/*
@ -375,7 +375,7 @@ fuzz_thread_resolver(void *arg) {
named_server_flushonshutdown(named_g_server,
false);
isc_loopmgr_shutdown(named_g_loopmgr);
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_loopmgr_shutdown(named_g_loopmgr);
return (NULL);
return NULL;
}
#endif /* ENABLE_AFL */

View file

@ -43,7 +43,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);
@ -51,7 +51,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,
@ -59,7 +59,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 */

View file

@ -89,14 +89,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
@ -237,7 +237,7 @@ named_log_setdefaultcategory(isc_logconfig_t *lcfg) {
}
cleanup:
return (result);
return result;
}
isc_result_t
@ -246,7 +246,7 @@ named_log_setunmatchedcategory(isc_logconfig_t *lcfg) {
result = isc_log_usechannel(lcfg, "null", NAMED_LOGCATEGORY_UNMATCHED,
NULL);
return (result);
return result;
}
void

View file

@ -57,11 +57,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;
@ -80,10 +80,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;
}
/*%
@ -131,7 +131,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;
@ -310,7 +310,7 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
}
done:
return (result);
return result;
}
isc_result_t
@ -365,8 +365,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;
}

View file

@ -406,7 +406,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 {
@ -1043,7 +1043,7 @@ create_managers(void) {
isc_nm_maxudp(named_g_netmgr, maxudp);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static void
@ -1437,7 +1437,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) {
@ -1446,7 +1446,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) {
@ -1455,7 +1455,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) {
@ -1463,7 +1463,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) {
@ -1473,12 +1473,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 */
@ -1635,5 +1635,5 @@ main(int argc, char *argv[]) {
ProfilerStop();
#endif /* ifdef HAVE_GPERFTOOLS_PROFILER */
return (0);
return 0;
}

View file

@ -400,15 +400,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
@ -521,9 +521,9 @@ named_os_changeuser(bool permanent) {
uid_t
named_os_uid(void) {
if (runas_pw == NULL) {
return (0);
return 0;
}
return (runas_pw->pw_uid);
return runas_pw->pw_uid;
}
void
@ -587,22 +587,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
@ -650,7 +650,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 */
@ -672,11 +672,11 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
}
*slash = '/';
}
return (0);
return 0;
error:
*slash = '/';
return (-1);
return -1;
}
FILE *
@ -693,11 +693,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);
@ -737,7 +737,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");
@ -747,7 +747,7 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
filename, strbuf);
}
return (fp);
return fp;
}
void
@ -863,5 +863,5 @@ named_os_uname(void) {
if (unamep == NULL) {
getuname();
}
return (unamep);
return unamep;
}

File diff suppressed because it is too large Load diff

View file

@ -126,19 +126,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 */
@ -251,7 +251,7 @@ get_histo_desc(const char *prefix, int i, int inf, bool ext) {
}
INSIST(0 < len && (size_t)len < space);
used += len + 1;
return (desc);
return desc;
}
static void
@ -814,8 +814,8 @@ dump_stats(isc_stats_t *stats, isc_statsformat_t type, void *arg,
memset(values, 0, sizeof(values[0]) * ncounters);
isc_stats_dump(stats, generalstat_dump, &dumparg, options);
return (dump_counters(type, arg, category, desc, ncounters, indices,
values, options));
return dump_counters(type, arg, category, desc, ncounters, indices,
values, options);
}
#if defined(EXTENDED_STATS)
@ -831,8 +831,8 @@ dump_histo(isc_histomulti_t *hm, isc_statsformat_t type, void *arg,
}
isc_histo_destroy(&hg);
return (dump_counters(type, arg, category, desc, ncounters, indices,
values, options));
return dump_counters(type, arg, category, desc, ncounters, indices,
values, options);
}
#endif /* defined(EXTENDED_STATS) */
@ -861,7 +861,7 @@ dump_counters(isc_statsformat_t type, void *arg, const char *category,
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);
}
@ -926,20 +926,20 @@ dump_counters(isc_statsformat_t type, void *arg, const char *category,
#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 */
}
@ -1009,7 +1009,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
@ -1293,7 +1293,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;
@ -1450,12 +1450,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
@ -1481,7 +1481,7 @@ xfrin_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;
}
if (dns_zone_getxfr(zone, &xfr, &is_firstrefresh, &is_running,
@ -1493,7 +1493,7 @@ xfrin_xmlrender(dns_zone_t *zone, void *arg) {
* (if any), but we still want to continue generating the
* remaining parts of the output.
*/
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
if (!is_running && !is_deferred && !is_presoa && !is_pending &&
@ -1503,12 +1503,12 @@ xfrin_xmlrender(dns_zone_t *zone, void *arg) {
dns_xfrin_detach(&xfr);
}
/* No ongoing/queued transfer. */
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
if (is_running && xfr == NULL) {
/* The transfer is finished, and it's shutting down. */
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "xfrin"));
@ -1718,7 +1718,7 @@ xfrin_xmlrender(dns_zone_t *zone, void *arg) {
dns_xfrin_detach(&xfr);
}
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
cleanup:
if (xfr != NULL) {
@ -1729,7 +1729,7 @@ cleanup:
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"Failed at xfrin_xmlrender()");
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
static isc_result_t
@ -2131,7 +2131,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,
@ -2143,7 +2143,7 @@ cleanup:
if (doc != NULL) {
xmlFreeDoc(doc);
}
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
static void
@ -2178,7 +2178,7 @@ render_xml(uint32_t flags, void *arg, unsigned int *retcode,
"failed at rendering XML()");
}
return (result);
return result;
}
static isc_result_t
@ -2188,8 +2188,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
@ -2199,8 +2199,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
@ -2210,8 +2210,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
@ -2221,8 +2221,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
@ -2232,8 +2232,8 @@ render_xml_xfrins(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_XFRINS, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
return render_xml(STATS_XML_XFRINS, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args);
}
static isc_result_t
@ -2243,8 +2243,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
@ -2254,8 +2254,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
@ -2265,8 +2265,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 */
@ -2306,7 +2306,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));
@ -2320,7 +2320,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
@ -2339,7 +2339,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));
@ -2358,7 +2358,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
}
if (zoneobj == NULL) {
return (ISC_R_NOMEMORY);
return ISC_R_NOMEMORY;
}
/*
@ -2526,7 +2526,7 @@ cleanup:
if (zoneobj != NULL) {
json_object_put(zoneobj);
}
return (result);
return result;
}
static isc_result_t
@ -2555,7 +2555,7 @@ xfrin_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));
@ -2780,7 +2780,7 @@ cleanup:
if (xfrinobj != NULL) {
json_object_put(xfrinobj);
}
return (result);
return result;
}
static isc_result_t
@ -2818,7 +2818,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;
}
/*
@ -3351,7 +3351,7 @@ cleanup:
json_object_put(bindstats);
}
return (result);
return result;
}
static isc_result_t
@ -3381,7 +3381,7 @@ render_json(uint32_t flags, void *arg, unsigned int *retcode,
"failed at rendering JSON()");
}
return (result);
return result;
}
static isc_result_t
@ -3391,8 +3391,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
@ -3402,8 +3402,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
@ -3413,8 +3413,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
@ -3424,8 +3424,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
@ -3435,8 +3435,8 @@ render_json_xfrins(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_XFRINS, arg, retcode, retmsg, mimetype,
b, freecb, freecb_args));
return render_json(STATS_JSON_XFRINS, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args);
}
static isc_result_t
@ -3446,8 +3446,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
@ -3457,8 +3457,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
@ -3468,8 +3468,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 */
@ -3532,7 +3532,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
@ -3567,7 +3567,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
match > 0)
{
UNLOCK(&listener->lock);
return (true);
return true;
}
UNLOCK(&listener->lock);
@ -3576,7 +3576,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
@ -3610,7 +3610,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;
@ -3714,7 +3714,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) {
@ -3723,7 +3723,7 @@ cleanup:
isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
return (result);
return result;
#endif
}
@ -3919,7 +3919,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
@ -4157,5 +4157,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 */
}

View file

@ -55,7 +55,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;
@ -91,9 +91,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;
}

View file

@ -131,13 +131,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
@ -185,13 +185,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) \
@ -218,7 +218,7 @@ transport_list_fromconfig(const cfg_obj_t *config, dns_transport_list_t *list) {
obj = NULL;
}
return (result);
return result;
}
static void
@ -260,8 +260,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;
}

View file

@ -123,7 +123,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsigkeyring_t *ring,
dns_tsigkey_detach(&tsigkey);
}
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
failure:
if (secret != NULL) {
@ -131,7 +131,7 @@ failure:
}
cfg_obj_log(key, named_g_lctx, ISC_LOG_ERROR,
"configuring key '%s': %s", keyid, isc_result_totext(ret));
return (ret);
return ret;
}
isc_result_t
@ -172,9 +172,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;
}

View file

@ -148,7 +148,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 */
@ -171,14 +171,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);
@ -188,7 +188,7 @@ parse_acl:
}
dns_acl_detach(&acl);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
/*%
@ -208,7 +208,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) &&
@ -376,7 +376,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
cleanup:
dns_ssutable_detach(&table);
return (result);
return result;
}
/*
@ -418,7 +418,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) {
@ -426,7 +426,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) {
@ -457,7 +457,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 */
@ -471,7 +471,7 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
&region);
ISC_LIST_APPEND(rdatalist_ns->rdata, rdata, link);
return (result);
return result;
}
/*%
@ -512,14 +512,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);
@ -533,7 +533,7 @@ configure_staticstub_servernames(const cfg_obj_t *zconfig, dns_zone_t *zone,
ISC_LIST_APPEND(rdatalist->rdata, rdata, link);
}
return (result);
return result;
}
/*%
@ -673,7 +673,7 @@ cleanup:
INSIST(dbversion == NULL);
return (result);
return result;
}
/*%
@ -686,7 +686,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);
}
/*%
@ -717,11 +717,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;
}
/*%
@ -733,7 +733,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 };
@ -780,12 +780,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);
@ -828,7 +828,7 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey, const isc_sockaddr_t *srcaddr,
break;
}
}
return (view == myview);
return view == myview;
}
/*%
@ -846,7 +846,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;
}
/*
@ -860,7 +860,7 @@ process_notifytype(dns_notifytype_t ntype, dns_zonetype_t ztype,
zname);
}
return (dns_notifytype_explicit);
return dns_notifytype_explicit;
}
isc_result_t
@ -1912,7 +1912,7 @@ cleanup:
if (kasp != NULL) {
dns_kasp_detach(&kasp);
}
return (result);
return result;
}
/*
@ -1927,11 +1927,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
@ -1955,7 +1955,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 */
@ -1976,17 +1976,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;
@ -2002,10 +2002,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
@ -2039,13 +2039,13 @@ named_zone_inlinesigning(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
if (res != ISC_R_SUCCESS ||
strcmp(cfg_obj_asstring(policy), "none") == 0)
{
return (false);
return false;
}
/* Lookup the policy. */
res = dns_kasplist_find(kasplist, cfg_obj_asstring(policy), &kasp);
if (res != ISC_R_SUCCESS) {
return (false);
return false;
}
inline_signing = dns_kasp_inlinesigning(kasp);
@ -2058,8 +2058,8 @@ named_zone_inlinesigning(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
*/
res = cfg_map_get(maps[0], "inline-signing", &signing);
if (res == ISC_R_SUCCESS && cfg_obj_isboolean(signing)) {
return (cfg_obj_asboolean(signing));
return cfg_obj_asboolean(signing);
}
return (inline_signing);
return inline_signing;
}

View file

@ -256,7 +256,7 @@ getzoneclass(void) {
if (zoneclass == dns_rdataclass_none) {
zoneclass = defaultclass;
}
return (zoneclass);
return zoneclass;
}
static bool
@ -266,9 +266,9 @@ setzoneclass(dns_rdataclass_t rdclass) {
zoneclass = rdclass;
}
if (zoneclass != rdclass) {
return (false);
return false;
}
return (true);
return true;
}
static void
@ -332,7 +332,7 @@ nsu_strsep(char **stringp, const char *delim) {
char sc, dc;
if (string == NULL) {
return (NULL);
return NULL;
}
for (; *string != '\0'; string++) {
@ -353,11 +353,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
@ -393,7 +393,7 @@ parse_hmac(const char *hmacstr, size_t len, dst_algorithm_t *hmac_alg,
if (len >= sizeof(buf)) {
error("unknown key type '%.*s'", (int)(len), hmacstr);
return (false);
return false;
}
/* Copy len bytes and NUL terminate. */
@ -406,7 +406,7 @@ parse_hmac(const char *hmacstr, size_t len, dst_algorithm_t *hmac_alg,
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) {
@ -416,7 +416,7 @@ parse_hmac(const char *hmacstr, size_t len, dst_algorithm_t *hmac_alg,
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) {
@ -426,7 +426,7 @@ parse_hmac(const char *hmacstr, size_t len, dst_algorithm_t *hmac_alg,
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) {
@ -436,7 +436,7 @@ parse_hmac(const char *hmacstr, size_t len, dst_algorithm_t *hmac_alg,
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) {
@ -446,7 +446,7 @@ parse_hmac(const char *hmacstr, size_t len, dst_algorithm_t *hmac_alg,
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) {
@ -456,14 +456,14 @@ parse_hmac(const char *hmacstr, size_t len, dst_algorithm_t *hmac_alg,
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
@ -477,7 +477,7 @@ basenamelen(const char *file) {
} else if (len > 4 && strcmp(file + len - 4, ".key") == 0) {
len -= 4;
}
return (len);
return len;
}
static void
@ -573,7 +573,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);
@ -619,7 +619,7 @@ cleanup:
isc_mem_free(mctx, keystr);
}
return (result);
return result;
}
static void
@ -797,8 +797,8 @@ create_name(const char *str, char *namedata, size_t len, dns_name_t *name) {
isc_buffer_add(&namesrc, strlen(str));
isc_buffer_init(&namebuf, namedata, len);
return (dns_name_fromtext(name, &namesrc, dns_rootname,
DNS_NAME_DOWNCASE, &namebuf));
return dns_name_fromtext(name, &namesrc, dns_rootname,
DNS_NAME_DOWNCASE, &namebuf);
}
static void
@ -1003,7 +1003,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;
}
#define PARSE_ARGS_FMT "46A:C:dDE:ghH:iK:lL:MoOk:p:Pr:R:St:Tu:vVy:"
@ -1313,7 +1313,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;
}
dns_message_gettempname(msg, namep);
@ -1324,10 +1324,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
@ -1342,7 +1342,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)) {
@ -1373,13 +1373,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
@ -1402,7 +1402,7 @@ make_prereq(char *cmdline, bool ispositive, bool isrrset) {
*/
retval = parse_name(&cmdline, updatemsg, &name);
if (retval != STATUS_MORE) {
return (retval);
return retval;
}
/*
@ -1482,13 +1482,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
@ -1500,7 +1500,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;
@ -1516,9 +1516,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 void
@ -1564,7 +1564,7 @@ evaluate_lease(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")) {
@ -1573,12 +1573,12 @@ evaluate_lease(char *cmdline) {
keylease = 0;
keylease_set = false;
updateopt();
return (STATUS_MORE);
return STATUS_MORE;
}
result = isc_parse_uint32(&value1, word, 10);
if (result != ISC_R_SUCCESS) {
return (STATUS_SYNTAX);
return STATUS_SYNTAX;
}
word = nsu_strsep(&cmdline, " \t\r\n");
@ -1588,12 +1588,12 @@ evaluate_lease(char *cmdline) {
keylease = 0;
keylease_set = false;
updateopt();
return (STATUS_MORE);
return STATUS_MORE;
}
result = isc_parse_uint32(&value2, word, 10);
if (result != ISC_R_SUCCESS) {
return (STATUS_SYNTAX);
return STATUS_SYNTAX;
}
lease = value1;
@ -1602,7 +1602,7 @@ evaluate_lease(char *cmdline) {
keylease_set = true;
updateopt();
return (STATUS_MORE);
return STATUS_MORE;
}
static uint16_t
@ -1612,13 +1612,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;
@ -1630,13 +1630,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;
}
}
@ -1654,10 +1654,10 @@ evaluate_server(char *cmdline) {
servers = isc_mem_cget(gmctx, 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
@ -1670,7 +1670,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;
@ -1682,13 +1682,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;
}
}
@ -1704,10 +1704,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
@ -1728,7 +1728,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);
@ -1736,7 +1736,7 @@ evaluate_key(char *cmdline) {
n = strchr(namestr, ':');
if (n != NULL) {
if (!parse_hmac(namestr, n - namestr, &hmac_alg, &digestbits)) {
return (STATUS_SYNTAX);
return STATUS_SYNTAX;
}
namestr = n + 1;
} else {
@ -1748,13 +1748,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);
@ -1765,7 +1765,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);
@ -1778,10 +1778,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
@ -1793,7 +1793,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);
@ -1803,10 +1803,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
@ -1823,19 +1823,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 */
}
@ -1848,29 +1848,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
@ -1883,7 +1883,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;
@ -1891,19 +1891,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
@ -1927,7 +1927,7 @@ update_addordelete(char *cmdline, bool isdelete) {
*/
retval = parse_name(&cmdline, updatemsg, &name);
if (retval != STATUS_MORE) {
return (retval);
return retval;
}
dns_message_gettemprdata(updatemsg, &rdata);
@ -2113,14 +2113,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
@ -2132,7 +2132,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;
@ -2142,9 +2142,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
@ -2155,7 +2155,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)
@ -2168,9 +2168,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 uint16_t
@ -2181,7 +2181,7 @@ evaluate_checksvcb(char *cmdline) {
word = nsu_strsep(&cmdline, " \t\r\n");
if (word == NULL || *word == 0) {
fprintf(stderr, "could not read check-svcb directive\n");
return (STATUS_SYNTAX);
return STATUS_SYNTAX;
}
if (strcasecmp(word, "yes") == 0 || strcasecmp(word, "true") == 0 ||
strcasecmp(word, "on") == 0)
@ -2194,9 +2194,9 @@ evaluate_checksvcb(char *cmdline) {
checksvcb = false;
} else {
fprintf(stderr, "incorrect check-svcb directive: %s\n", word);
return (STATUS_SYNTAX);
return STATUS_SYNTAX;
}
return (STATUS_MORE);
return STATUS_MORE;
}
static void
@ -2274,58 +2274,58 @@ 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, "lease") == 0) {
return (evaluate_lease(cmdline));
return evaluate_lease(cmdline);
}
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) {
@ -2333,14 +2333,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);
@ -2348,24 +2348,24 @@ 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, "check-svcb") == 0 ||
strcasecmp(word, "checksvcb") == 0)
{
return (evaluate_checksvcb(cmdline));
return evaluate_checksvcb(cmdline);
}
if (strcasecmp(word, "gsstsig") == 0) {
#if HAVE_GSSAPI
@ -2373,7 +2373,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
@ -2381,7 +2381,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"
@ -2421,14 +2421,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
@ -2460,7 +2460,7 @@ get_next_command(void) {
free(ptr);
}
return (result);
return result;
}
static bool
@ -2475,9 +2475,9 @@ user_interaction(void) {
}
}
if (result == STATUS_SEND) {
return (true);
return true;
}
return (false);
return false;
}
static void
@ -2522,10 +2522,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
@ -3575,8 +3575,8 @@ main(int argc, char **argv) {
cleanup();
if (seenerror) {
return (2);
return 2;
}
return (0);
return 0;
}

View file

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

View file

@ -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;
}
/**
@ -366,7 +366,7 @@ cleanup:
plugin_destroy((void **)&inst);
}
return (result);
return result;
}
isc_result_t
@ -394,7 +394,7 @@ cleanup:
if (parser != NULL) {
cfg_parser_destroy(&parser);
}
return (result);
return result;
}
/*
@ -424,7 +424,7 @@ plugin_destroy(void **instp) {
*/
int
plugin_version(void) {
return (NS_PLUGIN_VERSION);
return NS_PLUGIN_VERSION;
}
/**
@ -449,14 +449,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;
}
/*
@ -467,9 +467,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 *
@ -482,7 +482,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
@ -578,7 +578,7 @@ process_name(query_ctx_t *qctx, filter_aaaa_t mode, const dns_name_t *name,
}
cleanup:
return (modified);
return modified;
}
/*%
@ -649,7 +649,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;
}
/*
@ -667,7 +667,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) {
@ -684,7 +684,7 @@ filter_prep_response_begin(void *arg, void *cbdata, isc_result_t *resp) {
}
}
return (NS_HOOK_CONTINUE);
return NS_HOOK_CONTINUE;
}
/*
@ -704,7 +704,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 &&
@ -712,7 +712,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) {
@ -784,11 +784,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;
}
/*
@ -821,7 +821,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;
}
/*
@ -858,7 +858,7 @@ filter_query_done_send(void *arg, void *cbdata, isc_result_t *resp) {
}
}
return (NS_HOOK_CONTINUE);
return NS_HOOK_CONTINUE;
}
/*
@ -873,10 +873,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;
}

View file

@ -1023,8 +1023,8 @@ main(int argc, char **argv) {
isc_managers_destroy(&rndc_mctx, &loopmgr, &netmgr);
if (failed) {
return (1);
return 1;
}
return (0);
return 0;
}

View file

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

View file

@ -103,7 +103,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
@ -134,8 +134,8 @@ 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 DNS__DB_FLARG_PASS));
return dns__db_findnode(sampledb->rbtdb, name, create,
nodep DNS__DB_FLARG_PASS);
}
static isc_result_t
@ -147,9 +147,9 @@ 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 DNS__DB_FLARG_PASS));
return dns__db_find(sampledb->rbtdb, name, version, type, options, now,
nodep, foundname, rdataset,
sigrdataset DNS__DB_FLARG_PASS);
}
static isc_result_t
@ -161,9 +161,9 @@ 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 DNS__DB_FLARG_PASS));
return dns__db_findzonecut(sampledb->rbtdb, name, options, now, nodep,
foundname, dcname, rdataset,
sigrdataset DNS__DB_FLARG_PASS);
}
static void
@ -192,7 +192,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
@ -204,9 +204,9 @@ 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 DNS__DB_FLARG_PASS));
return dns__db_findrdataset(sampledb->rbtdb, node, version, type,
covers, now, rdataset,
sigrdataset DNS__DB_FLARG_PASS);
}
static isc_result_t
@ -217,8 +217,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 DNS__DB_FLARG_PASS));
return dns__db_allrdatasets(sampledb->rbtdb, node, version, options,
now, iteratorp DNS__DB_FLARG_PASS);
}
static isc_result_t
@ -244,7 +244,7 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
}
cleanup:
return (result);
return result;
}
static isc_result_t
@ -275,7 +275,7 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
}
cleanup:
return (result);
return result;
}
/*
@ -289,8 +289,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 DNS__DB_FLARG_PASS));
return dns__db_deleterdataset(sampledb->rbtdb, node, version, type,
covers DNS__DB_FLARG_PASS);
}
static bool
@ -299,7 +299,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
@ -308,7 +308,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);
}
static void
@ -326,8 +326,7 @@ getoriginnode(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG) {
REQUIRE(VALID_SAMPLEDB(sampledb));
return (dns__db_getoriginnode(sampledb->rbtdb,
nodep DNS__DB_FLARG_PASS));
return dns__db_getoriginnode(sampledb->rbtdb, nodep DNS__DB_FLARG_PASS);
}
static isc_result_t
@ -338,8 +337,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
@ -349,8 +348,8 @@ 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 DNS__DB_FLARG_PASS));
return dns__db_findnsec3node(sampledb->rbtdb, name, create,
nodep DNS__DB_FLARG_PASS);
}
static isc_result_t
@ -359,7 +358,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
@ -369,7 +368,7 @@ getsigningtime(dns_db_t *db, isc_stdtime_t *resign, dns_name_t *name,
REQUIRE(VALID_SAMPLEDB(sampledb));
return (dns_db_getsigningtime(sampledb->rbtdb, resign, name, type));
return dns_db_getsigningtime(sampledb->rbtdb, resign, name, type);
}
static dns_stats_t *
@ -378,7 +377,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
@ -389,8 +388,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 DNS__DB_FLARG_PASS));
return dns__db_findnodeext(sampledb->rbtdb, name, create, methods,
clientinfo, nodep DNS__DB_FLARG_PASS);
}
static isc_result_t
@ -403,9 +402,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 DNS__DB_FLARG_PASS));
return dns__db_findext(sampledb->rbtdb, name, version, type, options,
now, nodep, foundname, methods, clientinfo,
rdataset, sigrdataset DNS__DB_FLARG_PASS);
}
static isc_result_t
@ -414,7 +413,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 isc_result_t
@ -423,7 +422,7 @@ nodefullname(dns_db_t *db, dns_dbnode_t *node, dns_name_t *name) {
REQUIRE(VALID_SAMPLEDB(sampledb));
return (dns_db_nodefullname(sampledb->rbtdb, node, name));
return dns_db_nodefullname(sampledb->rbtdb, node, name);
}
/*
@ -499,7 +498,7 @@ cleanup:
if (node != NULL) {
dns_db_detachnode(db, &node);
}
return (result);
return result;
}
static isc_result_t
@ -537,7 +536,7 @@ cleanup:
if (node != NULL) {
dns_db_detachnode(db, &node);
}
return (result);
return result;
}
static isc_result_t
@ -573,7 +572,7 @@ cleanup:
if (node != NULL) {
dns_db_detachnode(db, &node);
}
return (result);
return result;
}
/*
@ -633,7 +632,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 (dns_name_dynamic(&sampledb->common.origin)) {
@ -643,5 +642,5 @@ cleanup:
isc_mem_putanddetach(&sampledb->common.mctx, sampledb,
sizeof(*sampledb));
return (result);
return result;
}

View file

@ -138,7 +138,7 @@ cleanup:
isc_mem_cput(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;
}

View file

@ -99,7 +99,7 @@ parse_params(isc_mem_t *mctx, int argc, char **argv, dns_name_t *z1,
result = ISC_R_SUCCESS;
cleanup:
return (result);
return result;
}
/*
@ -152,7 +152,7 @@ cleanup:
if (result != ISC_R_SUCCESS) {
destroy_sample_instance(&inst);
}
return (result);
return result;
}
/*
@ -194,7 +194,7 @@ load_sample_instance_zones(sample_instance_t *inst) {
}
cleanup:
return (result);
return result;
}
void

View file

@ -190,7 +190,7 @@ cleanup:
dns_rdata_freestruct(&ipv6);
}
return (result);
return result;
}
/*
@ -287,7 +287,7 @@ cleanup:
isc_mem_put(mctx, syncptr, sizeof(*syncptr));
}
return (result);
return result;
}
/*
@ -318,5 +318,5 @@ syncptrs(sample_instance_t *inst, dns_name_t *name, dns_rdataset_t *rdataset,
}
cleanup:
return (result);
return result;
}

View file

@ -100,7 +100,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);
@ -116,7 +116,7 @@ cleanup:
dns_acl_detach(&acl_any);
}
return (result);
return result;
}
/*
@ -188,7 +188,7 @@ cleanup:
dns_view_freeze(inst->view);
}
return (result);
return result;
}
/*
@ -223,7 +223,7 @@ load_zone(dns_zone_t *zone) {
}
cleanup:
return (result);
return result;
}
/*
@ -253,5 +253,5 @@ activate_zone(sample_instance_t *inst, dns_zone_t *raw) {
}
cleanup:
return (result);
return result;
}

View file

@ -65,7 +65,7 @@ int
main(int argc, char **argv) {
if (argc != 2) {
usage();
return (1);
return 1;
}
if (strcmp(argv[1], "--edns-version") == 0) {
@ -74,30 +74,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 */
}
@ -107,9 +107,9 @@ main(int argc, char **argv) {
if (fips != NULL) {
OSSL_PROVIDER_unload(fips);
}
return (fips != NULL ? 0 : 1);
return fips != NULL ? 0 : 1;
#else
return (1);
return 1;
#endif
}
@ -120,89 +120,89 @@ 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-fips-dh") == 0) {
#if defined(ENABLE_FIPS_MODE)
#if OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_API_LEVEL >= 30000
return (0);
return 0;
#else
return (1);
return 1;
#endif
#else
if (isc_fips_mode()) {
#if OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_API_LEVEL >= 30000
return (0);
return 0;
#else
return (1);
return 1;
#endif
}
return (0);
return 0;
#endif
}
if (strcmp(argv[1], "--have-fips-mode") == 0) {
#if defined(ENABLE_FIPS_MODE)
return (0);
return 0;
#else
return (isc_fips_mode() ? 0 : 1);
return isc_fips_mode() ? 0 : 1;
#endif
}
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], "--have-openssl-cipher-suites") == 0) {
#ifdef HAVE_SSL_CTX_SET_CIPHERSUITES
return (0);
return 0;
#else /* ifdef HAVE_SSL_CTX_SET_CIPHERSUITES */
return (1);
return 1;
#endif /* ifdef HAVE_SSL_CTX_SET_CIPHERSUITES */
}
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
}
@ -215,7 +215,7 @@ main(int argc, char **argv) {
answer = dst_algorithm_supported(DST_ALG_HMACMD5) ? 0 : 1;
dst_lib_destroy();
isc_mem_detach(&mctx);
return (answer);
return answer;
}
if (strcmp(argv[1], "--ipv6only=no") == 0) {
@ -231,9 +231,9 @@ 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) */
}
@ -245,50 +245,50 @@ main(int argc, char **argv) {
answer = dst_algorithm_supported(DST_ALG_RSASHA1) ? 0 : 1;
dst_lib_destroy();
isc_mem_detach(&mctx);
return (answer);
return answer;
}
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;
}

View file

@ -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
@ -304,7 +304,7 @@ doasync(query_ctx_t *qctx, isc_mem_t *mctx, void *arg, isc_loop_t *loop,
isc_async_run(loop, cb, rev);
*ctxp = ctx;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static ns_hookresult_t
@ -321,7 +321,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 */
@ -329,7 +329,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
@ -341,10 +341,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;
}

View file

@ -64,20 +64,20 @@ loadzone(dns_db_t **db, const char *origin, const char *filename) {
result = dns_name_fromstring(name, origin, dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
result = dns_db_create(mctx, ZONEDB_DEFAULT, 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);
if (result == DNS_R_SEENINCLUDE) {
result = ISC_R_SUCCESS;
}
return (result);
return result;
}
int
@ -90,7 +90,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];
@ -156,5 +156,5 @@ cleanup:
isc_mem_destroy(&mctx);
}
return (result != ISC_R_SUCCESS ? 1 : 0);
return result != ISC_R_SUCCESS ? 1 : 0;
}

View file

@ -130,7 +130,7 @@ sendquery(void) {
c = scanf("%255s", host);
if (c == EOF) {
return (ISC_R_NOMORE);
return ISC_R_NOMORE;
}
onfly++;
@ -166,7 +166,7 @@ sendquery(void) {
isc_loop_main(loopmgr), recvresponse, message, &request);
CHECK("dns_request_create", result);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static void
@ -300,5 +300,5 @@ main(int argc, char *argv[]) {
isc_managers_destroy(&mctx, &loopmgr, &netmgr);
return (0);
return 0;
}

View file

@ -32,11 +32,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
@ -84,5 +84,5 @@ out:
close(fd);
}
return (ret);
return ret;
}

View file

@ -64,14 +64,14 @@ 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 'n':
if (!link_dnsrps(&emsg)) {
fprintf(stderr, "## %s\n", emsg.c);
return (1);
return 1;
}
#ifdef USE_DNSRPS
/*
@ -81,7 +81,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;", optarg);
client = librpz->client_create(&emsg, clist, cstr,
@ -89,7 +89,7 @@ main(int argc, char **argv) {
if (client == NULL) {
fprintf(stderr, "## %s\n", emsg.c);
librpz->clist_detach(&clist);
return (1);
return 1;
}
rsp = NULL;
@ -100,7 +100,7 @@ main(int argc, char **argv) {
fprintf(stderr, "## %s\n", emsg.c);
librpz->client_detach(&client);
librpz->clist_detach(&clist);
return (1);
return 1;
}
if (!librpz->soa_serial(&emsg, &serial, optarg, rsp)) {
@ -108,7 +108,7 @@ main(int argc, char **argv) {
librpz->rsp_detach(&rsp);
librpz->client_detach(&client);
librpz->clist_detach(&clist);
return (1);
return 1;
}
librpz->rsp_detach(&rsp);
librpz->client_detach(&client);
@ -117,24 +117,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
@ -142,12 +142,12 @@ link_dnsrps(librpz_emsg_t *emsg) {
#ifdef USE_DNSRPS
librpz = librpz_lib_open(emsg, NULL, LIBRPZ_LIB_OPEN);
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 */
}

File diff suppressed because it is too large Load diff

View file

@ -68,7 +68,7 @@ str_printf(const char *fmt, ...) {
perror("strdup");
}
return (result);
return result;
}
/*
@ -85,7 +85,7 @@ get_address_info(const char *astr, int *pfamily, char *pbuf,
bool is_ipv6 = false;
if (astr == NULL || pfamily == NULL || pbuf == NULL) {
return (-1);
return -1;
}
strncpy(tmpc, astr, sizeof(tmpc) - 1);
@ -140,7 +140,7 @@ get_address_info(const char *astr, int *pfamily, char *pbuf,
errno = 0;
hexval = strtoul(tok, &eptr, 16);
if (errno != 0) {
return (-1);
return -1;
}
hex_values[lcount - 2] = hexval;
}
@ -154,7 +154,7 @@ get_address_info(const char *astr, int *pfamily, char *pbuf,
/* Not acceptable for either address family. */
if (lcount > 9) {
return (-1);
return -1;
}
*pfamily = (!is_ipv6 && (lcount == 5)) ? AF_INET : AF_INET6;
@ -172,9 +172,9 @@ get_address_info(const char *astr, int *pfamily, char *pbuf,
(optname ? optname : astr), prefix);
}
return (-1);
return -1;
} else if (bcount > 0) {
return (-1);
return -1;
}
sprintf(pbuf, "%u.%u.%u.%u", values[3], values[2], values[1],
@ -190,7 +190,7 @@ get_address_info(const char *astr, int *pfamily, char *pbuf,
(optname ? optname : astr), prefix);
}
return (-1);
return -1;
}
*pbuf = 0;
@ -204,7 +204,7 @@ get_address_info(const char *astr, int *pfamily, char *pbuf,
strcat(pbuf, ":");
} else {
if (hex_values[n - 1] > 0xffff) {
return (-1);
return -1;
} else if (n > 1) {
sprintf(&pbuf[strlen(pbuf)],
"%x:", hex_values[n - 1]);
@ -216,7 +216,7 @@ get_address_info(const char *astr, int *pfamily, char *pbuf,
}
}
return (0);
return 0;
}
rpz_soa_t *
@ -229,7 +229,7 @@ parse_serial(unsigned char *rdata, size_t rdlen) {
result = calloc(1, sizeof(*result));
if (result == NULL) {
perror("calloc");
return (NULL);
return NULL;
}
mlen = wdns_domain_to_str(rdata, rdlen, dname);
@ -247,7 +247,7 @@ parse_serial(unsigned char *rdata, size_t rdlen) {
uptr++;
result->minimum = ntohl(*uptr);
return (result);
return result;
}
size_t
@ -257,7 +257,7 @@ wdns_domain_to_str(const uint8_t *src, size_t src_len, char *dst) {
uint8_t oclen;
if (src == NULL) {
return (0);
return 0;
}
oclen = *src;
@ -290,7 +290,7 @@ wdns_domain_to_str(const uint8_t *src, size_t src_len, char *dst) {
bytes_read++;
*dst = '\0';
return ((bytes_read));
return bytes_read;
}
/* Add parsed update specification to maintained list of nodes. */
@ -320,7 +320,7 @@ apply_update_to_set(trpz_result_t **results, size_t *pnresults,
fprintf(stderr,
"Error in determining IP address type: %s\n",
node);
return (NULL);
return NULL;
} else if (family == AF_INET) {
(*pzones)[zidx].has_triggers[0][trigger] = 1;
} else {
@ -343,7 +343,7 @@ apply_update_to_set(trpz_result_t **results, size_t *pnresults,
if (rptr->result.trig == trigger &&
rptr->result.policy == policy && rptr->ttl == ttl)
{
return (rptr);
return rptr;
}
rptr->result.trig = trigger;
@ -351,7 +351,7 @@ apply_update_to_set(trpz_result_t **results, size_t *pnresults,
rptr->result.zpolicy = policy;
rptr->ttl = ttl;
*modified = 1;
return (rptr);
return rptr;
}
}
@ -361,7 +361,7 @@ apply_update_to_set(trpz_result_t **results, size_t *pnresults,
*results = realloc(*results, (*pnresults * sizeof(**results)));
if (*results == NULL) {
perror("realloc");
return (NULL);
return NULL;
}
memset(&((*results)[*pnresults - 1]), 0, sizeof(**results));
@ -381,7 +381,7 @@ apply_update_to_set(trpz_result_t **results, size_t *pnresults,
}
*modified = 1;
return ((&((*results)[*pnresults - 1])));
return &((*results)[*pnresults - 1]);
}
/*
@ -409,7 +409,7 @@ add_other_rr(trpz_result_t *node, const char *rrtype, const char *val,
"Error determining policy record IPv4 address: "
"%s\n",
val);
return (-1);
return -1;
}
nrec.type = ns_t_a;
@ -430,7 +430,7 @@ add_other_rr(trpz_result_t *node, const char *rrtype, const char *val,
"Error determining policy record IPv6 address: "
"%s\n",
val);
return (-1);
return -1;
}
nrec.type = ns_t_aaaa;
@ -466,7 +466,7 @@ add_other_rr(trpz_result_t *node, const char *rrtype, const char *val,
"Error processing CNAME policy record data "
"(%d)!\n",
ret);
return (-1);
return -1;
}
nrec.rdlength = ret;
@ -481,7 +481,7 @@ add_other_rr(trpz_result_t *node, const char *rrtype, const char *val,
"Error processing DNAME policy record data "
"(%d)!\n",
ret);
return (-1);
return -1;
}
nrec.rdlength = ret;
@ -489,7 +489,7 @@ add_other_rr(trpz_result_t *node, const char *rrtype, const char *val,
fprintf(stderr,
"Error: unsupported policy record type: \"%s\"\n",
rrtype);
return (-1);
return -1;
}
for (n = 0; n < node->nrrs; n++) {
@ -501,7 +501,7 @@ add_other_rr(trpz_result_t *node, const char *rrtype, const char *val,
!memcmp(rptr->rdata, nrec.rdata, nrec.rdlength))
{
free(nrec.rdata);
return (n + 1);
return n + 1;
}
}
@ -517,7 +517,7 @@ add_other_rr(trpz_result_t *node, const char *rrtype, const char *val,
node->rrs[node->nrrs - 1] = nrec;
*modified = 1;
return (node->nrrs);
return node->nrrs;
}
void
@ -568,7 +568,7 @@ parse_zone_options(const char *str) {
unsigned long result = 0;
if (str == NULL || *str == 0) {
return (0);
return 0;
}
strncpy(tmpstr, str, sizeof(tmpstr) - 1);
@ -671,7 +671,7 @@ parse_zone_options(const char *str) {
}
/* LIBRPZ_POLICY_CNAME, */
return (result);
return result;
}
/*
@ -696,7 +696,7 @@ apply_update(const char *updstr, trpz_result_t **presults, size_t *pnresults,
nfield = sscanf(updstr, "%63s %255s %u %31s %255s", cmdbuf, nodebuf,
&ttl, rrbuf, databuf);
if (nfield < 1) {
return (-1);
return -1;
}
/*
@ -711,7 +711,7 @@ apply_update(const char *updstr, trpz_result_t **presults, size_t *pnresults,
recursive_only = false, no_nsip_wait_recurse = false;
if (nfield < 3) {
return (-1);
return -1;
}
if (!strcasecmp(rrbuf, "qname_as_ns")) {
@ -794,7 +794,7 @@ apply_update(const char *updstr, trpz_result_t **presults, size_t *pnresults,
true;
}
return (0);
return 0;
}
}
@ -836,15 +836,15 @@ apply_update(const char *updstr, trpz_result_t **presults, size_t *pnresults,
zptr->name[strlen(zptr->name) - 1] = 0;
}
return (0);
return 0;
} else if (nfield != 5) {
return (-1);
return -1;
}
if (strcasecmp(cmdbuf, "add")) {
fprintf(stderr, "Warning: only update add action is currently "
"supported!\n");
return (-1);
return -1;
}
if (!strcasecmp(rrbuf, "A")) {
@ -871,7 +871,7 @@ apply_update(const char *updstr, trpz_result_t **presults, size_t *pnresults,
if (ftext == NULL) {
fprintf(stderr, "Error parsing TXT record: \"%s\"\n",
updstr);
return (-1);
return -1;
}
if (*ftext == '"') {
@ -893,13 +893,13 @@ apply_update(const char *updstr, trpz_result_t **presults, size_t *pnresults,
fprintf(stderr,
"Warning: target \"%s\" is not currently supported!\n",
rrbuf);
return (-1);
return -1;
}
if (policy == LIBRPZ_POLICY_UNDEFINED) {
fprintf(stderr, "Error: could not determine appropriate policy "
"for update!\n");
return (-1);
return -1;
}
for (n = 0; (size_t)n < *pnzones; n++) {
@ -977,7 +977,7 @@ apply_update(const char *updstr, trpz_result_t **presults, size_t *pnresults,
}
if (zidx == -1) {
return (0);
return 0;
}
nodebuf[ndlen] = 0;
@ -1039,12 +1039,12 @@ apply_update(const char *updstr, trpz_result_t **presults, size_t *pnresults,
"Error: could not add policy record %s "
"/ %s\n",
rrbuf, databuf);
return (-1);
return -1;
}
}
}
return (0);
return 0;
}
/*
@ -1120,7 +1120,7 @@ sanity_check_data_file(const char *fname, char **errp) {
if (f == NULL) {
fprintf(stderr, "couldn't sanity check %s\n", fname);
perror("fopen");
return (-1);
return -1;
}
while (!feof(f)) {
@ -1239,7 +1239,7 @@ sanity_check_data_file(const char *fname, char **errp) {
out:
fclose(f);
return (result);
return result;
}
/* Load a database of nodes from a given filename. */
@ -1252,7 +1252,7 @@ load_all_updates(const char *fname, trpz_result_t **presults, size_t *pnresults,
if (f == NULL) {
fprintf(stderr, "couldn't load updates from %s\n", fname);
perror("fopen");
return (-1);
return -1;
}
while (!feof(f)) {
@ -1353,13 +1353,13 @@ load_all_updates(const char *fname, trpz_result_t **presults, size_t *pnresults,
fprintf(stderr,
"Error: could not apply update \"%s\"\n", lptr);
fclose(f);
return (-1);
return -1;
}
}
fclose(f);
return (0);
return 0;
}
#define WDNS_MAXLEN_NAME 255
@ -1383,7 +1383,7 @@ wdns_str_to_name(const char *str, uint8_t **pbuf, bool downcase) {
exit(EXIT_FAILURE);
}
*pbuf[0] = 0;
return (1);
return 1;
}
res = 0;
@ -1482,10 +1482,10 @@ wdns_str_to_name(const char *str, uint8_t **pbuf, bool downcase) {
slen--;
}
return (res);
return res;
out:
free(*pbuf);
*pbuf = NULL;
return (-1);
return -1;
}

View file

@ -150,7 +150,7 @@ main(int argc, char **argv) {
dns_log_setcontext(NULL);
dst_lib_destroy();
isc_mem_destroy(&mctx);
return (0);
return 0;
}
/*! \file */

View file

@ -74,12 +74,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
@ -87,11 +87,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
@ -102,16 +102,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
@ -120,12 +120,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
@ -134,12 +134,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
@ -157,7 +157,7 @@ parse_input(const char *input) {
close(in);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -170,7 +170,7 @@ parse_output(const char *input) {
}
RUNTIME_CHECK(out >= 0);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static void
@ -428,5 +428,5 @@ main(int argc, char **argv) {
teardown();
return (EXIT_SUCCESS);
return EXIT_SUCCESS;
}

View file

@ -56,12 +56,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
@ -69,11 +69,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
@ -83,15 +83,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
@ -100,12 +100,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
@ -234,7 +234,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
@ -303,5 +303,5 @@ main(int argc, char **argv) {
teardown();
return (EXIT_SUCCESS);
return EXIT_SUCCESS;
}

View file

@ -48,11 +48,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);
@ -97,7 +97,7 @@ printmessage(dns_message_t *msg) {
isc_mem_put(mctx, buf, len);
}
return (result);
return result;
}
int
@ -260,7 +260,7 @@ main(int argc, char *argv[]) {
}
isc_mem_destroy(&mctx);
return (0);
return 0;
}
static void

View file

@ -40,8 +40,8 @@ main(int argc, char *argv[]) {
argv++;
continue;
}
return (1);
return 1;
}
fflush(stdout);
return (ferror(stdout));
return ferror(stdout);
}

View file

@ -183,7 +183,7 @@ rcode_totext(dns_rcode_t rcode) {
} else {
totext.consttext = rcodetext[rcode];
}
return (totext.deconsttext);
return totext.deconsttext;
}
static void
@ -756,7 +756,7 @@ sendquery(struct query *query) {
message, &request);
CHECK("dns_request_create", result);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static void
@ -910,20 +910,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
@ -1041,7 +1041,7 @@ parse_netprefix(isc_sockaddr_t **sap, const char *value) {
sa->length = netmask;
*sap = sa;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
/*%
@ -1051,11 +1051,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
@ -1072,7 +1072,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
@ -1675,7 +1675,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':
@ -1686,7 +1686,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':
@ -1708,7 +1708,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];
@ -1751,7 +1751,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);
@ -1759,16 +1759,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);
@ -1776,14 +1776,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();
@ -1793,7 +1793,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
usage();
}
UNREACHABLE();
return (false);
return false;
}
static struct query *
@ -1813,7 +1813,7 @@ clone_default_query(void) {
query->timeout = tcp_mode ? TCPTIMEOUT : UDPTIMEOUT;
}
return (query);
return query;
}
/*%
@ -2221,5 +2221,5 @@ main(int argc, char *argv[]) {
}
isc_managers_destroy(&mctx, &loopmgr, &netmgr);
return (0);
return 0;
}

View file

@ -58,7 +58,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
@ -129,5 +129,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;
}

View file

@ -97,5 +97,5 @@ main(int argc, char *argv[]) {
mdb_txn_abort(txn);
mdb_env_close(env);
return (0);
return 0;
}

View file

@ -343,5 +343,5 @@ main(int argc, char *argv[]) {
}
cleanup();
return (0);
return 0;
}

View file

@ -191,5 +191,5 @@ skip:
nsec3hash(nsec3hash_print, argv[1], NULL, argv[2], argv[0],
argv[3]);
}
return (0);
return 0;
}

View file

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

View file

@ -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;
}
/*

View file

@ -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);
}

View file

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

View file

@ -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;
}
/*

View file

@ -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;
}
/*

View file

@ -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;
}
/*

View file

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

View file

@ -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

View file

@ -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;
}
/*

View file

@ -149,7 +149,7 @@ done:
free(querystring);
}
return (result);
return result;
}
isc_result_t
@ -163,9 +163,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;
}
}
@ -188,13 +188,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
@ -222,7 +222,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;
}
cd->record = UNCONST(name);
@ -233,7 +233,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';
@ -289,7 +289,7 @@ done:
free(querystring);
}
return (result);
return result;
}
isc_result_t
@ -302,7 +302,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;
}
cd->zone = UNCONST(p);
@ -345,7 +345,7 @@ done:
free(querystring);
}
return (result);
return result;
}
static void
@ -387,12 +387,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));
@ -470,7 +470,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);
@ -484,7 +484,7 @@ cleanup:
}
free(cd);
return (result);
return result;
}
void
@ -510,7 +510,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;
}
/*
@ -536,22 +536,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;
}
/*
@ -578,21 +578,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;
@ -607,24 +607,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;
}
@ -634,26 +634,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)) {
@ -663,7 +663,7 @@ fnmatch(const char *pattern, const char *string, int flags) {
pattern = newp;
break;
case RANGE_NOMATCH:
return (FNM_NOMATCH);
return FNM_NOMATCH;
}
++string;
break;
@ -683,7 +683,7 @@ fnmatch(const char *pattern, const char *string, int flags) {
tolower((unsigned char)*string)))
{
} else {
return (FNM_NOMATCH);
return FNM_NOMATCH;
}
string++;
break;
@ -724,11 +724,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) {
@ -743,7 +743,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) {
@ -759,5 +759,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;
}

View file

@ -185,8 +185,8 @@ main(int argc, char **argv) {
fflush(stdout);
if (ferror(stdout)) {
fprintf(stderr, "write error\n");
return (1);
return 1;
}
return (0);
return 0;
}

View file

@ -31,7 +31,7 @@ int
LLVMFuzzerInitialize(int *argc, char ***argv) {
UNUSED(argc);
UNUSED(argv);
return (0);
return 0;
}
int
@ -53,7 +53,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
dns_dbtype_zone, dns_rdataclass_in, 0, NULL,
&db);
if (result != ISC_R_SUCCESS) {
return (0);
return 0;
}
result = dns_db_beginload(db, &callbacks);
@ -75,5 +75,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
end:
dns_db_detach(&db);
isc_mem_destroy(&mctx);
return (0);
return 0;
}

View file

@ -141,14 +141,14 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_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);
@ -157,7 +157,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
fd = fopen(pathbuf, "w");
if (fd == NULL) {
fprintf(stderr, "fopen(%s) failed\n", pathbuf);
return (1);
return 1;
}
fputs(c2, fd);
fclose(fd);
@ -166,7 +166,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
fd = fopen(pathbuf, "w");
if (fd == NULL) {
fprintf(stderr, "fopen(%s) failed\n", pathbuf);
return (1);
return 1;
}
fputs(c3, fd);
fclose(fd);
@ -177,7 +177,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_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;
@ -187,7 +187,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "dns_view_create failed: %s\n",
isc_result_totext(result));
return (1);
return 1;
}
dns_tsigkeyring_create(mctx, &ring);
@ -197,7 +197,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
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, DST_ALG_HMACSHA256, secret,
@ -205,20 +205,20 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "dns_tsigkey_create failed: %s\n",
isc_result_totext(result));
return (1);
return 1;
}
result = dns_tsigkeyring_add(ring, tsigkey);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "dns_tsigkeyring_add failed: %s\n",
isc_result_totext(result));
return (1);
return 1;
}
result = dns_name_fromstring(name, "sig0key", dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "dns_name_fromstring failed: %s\n",
isc_result_totext(result));
return (1);
return 1;
}
dns_zone_create(&zone, mctx, 0);
@ -227,7 +227,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
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);
@ -237,7 +237,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_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,
@ -245,21 +245,21 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_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_zone_setview(zone, view);
@ -267,7 +267,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
dns_zone_detach(&zone);
return (0);
return 0;
}
static isc_result_t
@ -343,7 +343,7 @@ create_message(dns_message_t **messagep, const uint8_t *data, size_t size,
}
*messagep = message;
}
return (result);
return result;
}
int
@ -372,7 +372,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
* opcode.
*/
if (size > 65535 || size < 2) {
return (0);
return 0;
}
addasig = (*data & 0x80) != 0;
@ -397,7 +397,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;
}
/*
@ -476,5 +476,5 @@ cleanup:
dns_message_detach(&message);
}
return (0);
return 0;
}

View file

@ -39,7 +39,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
isc_mem_create(&mctx);
output = isc_mem_get(mctx, output_len);
return (0);
return 0;
}
static isc_result_t
@ -60,7 +60,7 @@ parse_message(isc_buffer_t *input, dns_message_t **messagep) {
dns_message_detach(&message);
}
return (result);
return result;
}
static isc_result_t
@ -85,7 +85,7 @@ print_message(dns_message_t *message) {
output);
}
return (result);
return result;
}
#define CHECKRESULT(r, f) \
@ -135,11 +135,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
@ -149,7 +149,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);
@ -181,5 +181,5 @@ cleanup:
dns_message_detach(&message);
}
return (0);
return 0;
}

View file

@ -26,7 +26,7 @@ bool debug = false;
int
LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
return (0);
return 0;
}
int
@ -47,5 +47,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
fprintf(stderr, "dns_name_fromtext: %s\n",
isc_result_totext(result));
}
return (0);
return 0;
}

View file

@ -30,7 +30,7 @@ bool debug = false;
int
LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
return (0);
return 0;
}
int
@ -99,5 +99,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
REQUIRE(new_buf.used == old_buf.used);
REQUIRE(new_buf.length == old_buf.length);
return (0);
return 0;
}

View file

@ -76,7 +76,7 @@ fuzz_makekey(dns_qpkey_t key, void *ctx, void *pval, uint32_t ival) {
assert(ctx == NULL);
assert(pval == &item[ival]);
memmove(key, item[ival].key, item[ival].len);
return (item[ival].len);
return item[ival].len;
}
static void
@ -94,7 +94,7 @@ const dns_qpmethods_t fuzz_methods = {
static uint8_t
random_byte(void) {
return (isc_random_uniform(SHIFT_OFFSET - SHIFT_NOBYTE) + SHIFT_NOBYTE);
return isc_random_uniform(SHIFT_OFFSET - SHIFT_NOBYTE) + SHIFT_NOBYTE;
}
int
@ -112,7 +112,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) {
qp_test_keytoascii(item[i].ascii, len);
}
return (0);
return 0;
}
int
@ -219,5 +219,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
assert(item[i].refcount == 0);
}
return (0);
return 0;
}

View file

@ -34,7 +34,7 @@ int
LLVMFuzzerInitialize(int *argc, char ***argv) {
UNUSED(argc);
UNUSED(argv);
return (0);
return 0;
}
int
@ -73,5 +73,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
assert((namerel == 0) == (keyrel == 0));
assert((namerel > 0) == (keyrel > 0));
return (0);
return 0;
}

View file

@ -37,7 +37,7 @@ int
LLVMFuzzerInitialize(int *argc, char ***argv) {
UNUSED(argc);
UNUSED(argv);
return (0);
return 0;
}
/* following code was copied from named-rrchecker */
@ -146,5 +146,5 @@ cleanup:
isc_lex_close(lex);
isc_lex_destroy(&lex);
isc_mem_destroy(&mctx);
return (0);
return 0;
}

View file

@ -56,7 +56,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
isc_lex_setspecials(lex, specials);
isc_lex_setcomments(lex, ISC_LEXCOMMENT_DNSMASTERFILE);
return (0);
return 0;
}
static void
@ -99,7 +99,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;
}
/*
@ -210,5 +210,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
assert(target.used == size);
assert(!memcmp(target.base, data, size));
return (0);
return 0;
}

View file

@ -38,7 +38,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
isc_mem_create(&mctx);
isc_lex_create(mctx, 1024, &lex);
return (0);
return 0;
}
int
@ -50,7 +50,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));
@ -71,5 +71,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;
}

View file

@ -31,7 +31,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
isc_mem_create(&mctx);
isc_lex_create(mctx, 1024, &lex);
return (0);
return 0;
}
int
@ -50,5 +50,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;
}

View file

@ -101,7 +101,7 @@ main(int argc, char **argv) {
ret = LLVMFuzzerInitialize(&argc, &argv);
if (ret != 0) {
fprintf(stderr, "LLVMFuzzerInitialize failure: %d\n", ret);
return (1);
return 1;
}
if (argv[1] != NULL && strcmp(argv[1], "-d") == 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
@ -142,7 +142,7 @@ main(int argc, char **argv) {
LLVMFuzzerInitialize(&argc, &argv);
if (ret != 0) {
fprintf(stderr, "LLVMFuzzerInitialize failure: %d\n", ret);
return (1);
return 1;
}
#ifdef __AFL_LOOP
@ -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 */

View file

@ -156,12 +156,12 @@ old_name_fromwire(dns_name_t *name, isc_buffer_t *source, dns_decompress_t dctx,
* 14-bit compression pointer
*/
if (!dns_decompress_getpermitted(dctx)) {
return (DNS_R_DISALLOWED);
return DNS_R_DISALLOWED;
}
new_current = c & 0x3F;
state = fw_newcurrent;
} else {
return (DNS_R_BADLABELTYPE);
return DNS_R_BADLABELTYPE;
}
break;
case fw_ordinary:
@ -178,7 +178,7 @@ old_name_fromwire(dns_name_t *name, isc_buffer_t *source, dns_decompress_t dctx,
new_current *= 256;
new_current += c;
if (new_current >= biggest_pointer) {
return (DNS_R_BADPOINTER);
return DNS_R_BADPOINTER;
}
biggest_pointer = new_current;
current = new_current;
@ -193,7 +193,7 @@ old_name_fromwire(dns_name_t *name, isc_buffer_t *source, dns_decompress_t dctx,
}
if (!done) {
return (ISC_R_UNEXPECTEDEND);
return ISC_R_UNEXPECTEDEND;
}
name->ndata = (unsigned char *)target->base + target->used;
@ -204,7 +204,7 @@ old_name_fromwire(dns_name_t *name, isc_buffer_t *source, dns_decompress_t dctx,
isc_buffer_forward(source, cused);
isc_buffer_add(target, name->length);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
full:
if (nmax == DNS_NAME_MAXWIRE) {
@ -212,12 +212,12 @@ full:
* The name did not fit even though we had a buffer
* big enough to fit a maximum-length name.
*/
return (DNS_R_NAMETOOLONG);
return DNS_R_NAMETOOLONG;
} else {
/*
* The name might fit if only the caller could give us a
* big enough buffer.
*/
return (ISC_R_NOSPACE);
return ISC_R_NOSPACE;
}
}

View file

@ -69,11 +69,11 @@ dns_acl_anyornone(isc_mem_t *mctx, bool neg, dns_acl_t **target) {
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;
}
/*
@ -81,7 +81,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);
}
/*
@ -89,7 +89,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);
}
/*
@ -103,11 +103,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 &&
@ -116,10 +116,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 */
}
/*
@ -127,7 +127,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);
}
/*
@ -135,7 +135,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);
}
/*
@ -213,7 +213,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
@ -258,10 +258,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);
}
/*
@ -351,7 +351,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;
@ -362,7 +362,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;
}
/*
@ -390,9 +390,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:
@ -401,7 +401,7 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
case dns_aclelementtype_localhost:
if (env == NULL) {
return (false);
return false;
}
rcu_read_lock();
dns_acl_attach(rcu_dereference(env->localhost), &inner);
@ -410,7 +410,7 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
case dns_aclelementtype_localnets:
if (env == NULL) {
return (false);
return false;
}
rcu_read_lock();
dns_acl_attach(rcu_dereference(env->localnets), &inner);
@ -420,9 +420,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();
@ -444,7 +444,7 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
if (matchelt != NULL) {
*matchelt = e;
}
return (true);
return true;
}
/*
@ -455,7 +455,7 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
*matchelt = NULL;
}
return (false);
return false;
}
static void
@ -578,7 +578,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 */
@ -597,7 +597,7 @@ dns_acl_isinsecure(const dns_acl_t *a) {
case dns_aclelementtype_nestedacl:
if (dns_acl_isinsecure(e->nestedacl)) {
return (true);
return true;
}
continue;
@ -605,7 +605,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();
@ -613,7 +613,7 @@ dns_acl_isinsecure(const dns_acl_t *a) {
}
/* No insecure elements were found. */
return (false);
return false;
}
/*%
@ -626,13 +626,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;
}
/*

View file

@ -531,7 +531,7 @@ ttlclamp(dns_ttl_t ttl) {
ttl = ADB_CACHE_MAXIMUM;
}
return (ttl);
return ttl;
}
/*
@ -640,12 +640,12 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset,
UNREACHABLE();
}
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static bool
match_ptr(void *node, const void *key) {
return (node == key);
return node == key;
}
/*
@ -832,12 +832,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);
@ -858,12 +858,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;
}
/*
@ -876,12 +876,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;
}
/*
@ -988,7 +988,7 @@ new_adbname(dns_adb_t *adb, const dns_name_t *dnsname, unsigned int flags) {
dns_name_init(&name->target, NULL);
inc_adbstats(adb, dns_adbstats_namescnt);
return (name);
return name;
}
#if DNS_ADB_TRACE
@ -1028,7 +1028,7 @@ new_adbnamehook(dns_adb_t *adb) {
.magic = DNS_ADBNAMEHOOK_MAGIC,
};
return (nh);
return nh;
}
static void
@ -1073,7 +1073,7 @@ new_adbentry(dns_adb_t *adb, const isc_sockaddr_t *addr, isc_stdtime_t now) {
inc_adbstats(adb, dns_adbstats_entriescnt);
return (entry);
return entry;
}
static void
@ -1129,7 +1129,7 @@ new_adbfind(dns_adb_t *adb, in_port_t port) {
find->magic = DNS_ADBFIND_MAGIC;
return (find);
return find;
}
static void
@ -1167,7 +1167,7 @@ new_adbfetch(dns_adb_t *adb) {
fetch->magic = DNS_ADBFETCH_MAGIC;
return (fetch);
return fetch;
}
static void
@ -1208,7 +1208,7 @@ new_adbaddrinfo(dns_adb_t *adb, dns_adbentry_t *entry, in_port_t port) {
isc_sockaddr_setport(&ai->sockaddr, port);
return (ai);
return ai;
}
static void
@ -1240,10 +1240,10 @@ match_adbname(void *node, const void *key) {
if ((adbname0->flags & ADBNAME_FLAGS_MASK) !=
(adbname1->flags & ADBNAME_FLAGS_MASK))
{
return (false);
return false;
}
return (dns_name_equal(adbname0->name, adbname1->name));
return dns_name_equal(adbname0->name, adbname1->name);
}
static uint32_t
@ -1255,7 +1255,7 @@ hash_adbname(const dns_adbname_t *adbname) {
isc_hash32_hash(&hash, adbname->name->ndata, adbname->name->length,
false);
isc_hash32_hash(&hash, &flags, sizeof(flags), true);
return (isc_hash32_finalize(&hash));
return isc_hash32_finalize(&hash);
}
/*
@ -1336,7 +1336,7 @@ get_attached_and_locked_name(dns_adb_t *adb, const dns_name_t *name,
*/
RWUNLOCK(&adb->names_lock, locktype);
return (adbname);
return adbname;
}
static void
@ -1353,7 +1353,7 @@ static bool
match_adbentry(void *node, const void *key) {
dns_adbentry_t *adbentry = node;
return (isc_sockaddr_equal(&adbentry->sockaddr, key));
return isc_sockaddr_equal(&adbentry->sockaddr, key);
}
/*
@ -1446,7 +1446,7 @@ get_attached_and_locked_entry(dns_adb_t *adb, isc_stdtime_t now,
RWUNLOCK(&adb->entries_lock, locktype);
return (adbentry);
return adbentry;
}
static void
@ -1533,12 +1533,12 @@ maybe_expire_name(dns_adbname_t *adbname, isc_stdtime_t now) {
/* Leave this name alone if it still has active namehooks... */
if (NAME_HAS_V4(adbname) || NAME_HAS_V6(adbname)) {
return (false);
return false;
}
/* ...an active fetch in progres... */
if (NAME_FETCH(adbname)) {
return (false);
return false;
}
/* ... or is not yet expired. */
@ -1546,12 +1546,12 @@ maybe_expire_name(dns_adbname_t *adbname, isc_stdtime_t now) {
!EXPIRE_OK(adbname->expire_v6, now) ||
!EXPIRE_OK(adbname->expire_target, now))
{
return (false);
return false;
}
expire_name(adbname, DNS_ADB_EXPIRED);
return (true);
return true;
}
static void
@ -1576,14 +1576,14 @@ expire_entry(dns_adbentry_t *adbentry) {
static bool
entry_expired(dns_adbentry_t *adbentry, isc_stdtime_t now) {
if (!ISC_LIST_EMPTY(adbentry->nhs)) {
return (false);
return false;
}
if (!EXPIRE_OK(adbentry->expires, now)) {
return (false);
return false;
}
return (true);
return true;
}
static bool
@ -1592,10 +1592,10 @@ maybe_expire_entry(dns_adbentry_t *adbentry, isc_stdtime_t now) {
if (entry_expired(adbentry, now)) {
expire_entry(adbentry);
return (true);
return true;
}
return (false);
return false;
}
/*%
@ -1955,7 +1955,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_loop_t *loop, isc_job_cb cb, void *cbarg,
DP(DEF_LEVEL, "dns_adb_createfind: returning "
"ISC_R_SHUTTINGDOWN");
return (ISC_R_SHUTTINGDOWN);
return ISC_R_SHUTTINGDOWN;
}
if (now == 0) {
@ -2242,7 +2242,7 @@ post_copy:
UNLOCK(&adbname->lock);
dns_adbname_detach(&adbname);
return (result);
return result;
}
void
@ -2347,7 +2347,7 @@ unsigned int
dns_adb_findstatus(dns_adbfind_t *find) {
REQUIRE(DNS_ADBFIND_VALID(find));
return (atomic_load(&find->status));
return atomic_load(&find->status);
}
void
@ -2590,11 +2590,11 @@ putstr(isc_buffer_t **b, const char *str) {
result = isc_buffer_reserve(*b, strlen(str));
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
isc_buffer_putstr(*b, str);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
isc_result_t
@ -2635,7 +2635,7 @@ dns_adb_dumpquota(dns_adb_t *adb, isc_buffer_t **buf) {
isc_hashmap_iter_destroy(&it);
RWUNLOCK(&adb->entries_lock, isc_rwlocktype_read);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -2782,7 +2782,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
@ -3038,7 +3038,7 @@ cleanup:
dns_rdataset_disassociate(&rdataset);
}
return (result);
return result;
}
void
@ -3286,7 +3286,7 @@ dns_adb_getudpsize(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
size = entry->udpsize;
UNLOCK(&entry->lock);
return (size);
return size;
}
void
@ -3341,7 +3341,7 @@ dns_adb_getcookie(dns_adbaddrinfo_t *addr, unsigned char *cookie, size_t len) {
unlock:
UNLOCK(&entry->lock);
return (len);
return len;
}
isc_result_t
@ -3357,7 +3357,7 @@ dns_adb_findaddrinfo(dns_adb_t *adb, const isc_sockaddr_t *sa,
in_port_t port;
if (atomic_load(&adb->exiting)) {
return (ISC_R_SHUTTINGDOWN);
return ISC_R_SHUTTINGDOWN;
}
entry = get_attached_and_locked_entry(adb, now, sa);
@ -3370,7 +3370,7 @@ dns_adb_findaddrinfo(dns_adb_t *adb, const isc_sockaddr_t *sa,
dns_adbentry_detach(&entry);
return (result);
return result;
}
void
@ -3536,14 +3536,14 @@ 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;
}
bool
dns_adb_overquota(dns_adb_t *adb ISC_ATTR_UNUSED, dns_adbaddrinfo_t *addrinfo) {
REQUIRE(DNS_ADBADDRINFO_VALID(addrinfo));
return (adbentry_overquota(addrinfo->entry));
return adbentry_overquota(addrinfo->entry);
}
void
@ -3572,5 +3572,5 @@ isc_stats_t *
dns_adb_getstats(dns_adb_t *adb) {
REQUIRE(DNS_ADB_VALID(adb));
return (adb->stats);
return adb->stats;
}

View file

@ -86,7 +86,7 @@ dns_badcache_new(isc_mem_t *mctx) {
isc_mem_attach(mctx, &bc->mctx);
return (bc);
return bc;
}
void
@ -114,7 +114,7 @@ bcentry_match(struct cds_lfht_node *ht_node, const void *key) {
const dns_name_t *name = key;
dns_bcentry_t *bad = caa_container_of(ht_node, dns_bcentry_t, ht_node);
return (dns_name_equal(bad->name, name));
return dns_name_equal(bad->name, name);
}
static dns_bcentry_t *
@ -132,7 +132,7 @@ bcentry_new(dns_badcache_t *bc, const dns_name_t *name,
bad->name = dns_fixedname_initname(&bad->fname);
dns_name_copy(name, bad->name);
return (bad);
return bad;
}
static void
@ -164,13 +164,13 @@ bcentry_evict(struct cds_lfht *ht, dns_bcentry_t *bad) {
static bool
bcentry_alive(struct cds_lfht *ht, dns_bcentry_t *bad, isc_stdtime_t now) {
if (cds_lfht_is_node_deleted(&bad->ht_node)) {
return (false);
return false;
} else if (atomic_load_relaxed(&bad->expire) < now) {
bcentry_evict(ht, bad);
return (false);
return false;
}
return (true);
return true;
}
#define cds_lfht_for_each_entry_next(ht, iter, pos, member) \
@ -283,7 +283,7 @@ dns_badcache_find(dns_badcache_t *bc, const dns_name_t *name,
rcu_read_unlock();
return (result);
return result;
}
void

View file

@ -74,11 +74,11 @@ dns_byaddr_createptrname(const isc_netaddr_t *address, dns_name_t *name) {
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);
}

View file

@ -143,7 +143,7 @@ cache_create_db(dns_cache_t *cache, dns_db_t **dbp, isc_mem_t **tmctxp,
*hmctxp = hmctx;
*tmctxp = tmctx;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
cleanup_db:
dns_db_detach(&db);
@ -151,7 +151,7 @@ cleanup_mctx:
isc_mem_detach(&hmctx);
isc_mem_detach(&tmctx);
return (result);
return result;
}
static void
@ -202,11 +202,11 @@ dns_cache_create(isc_loopmgr_t *loopmgr, dns_rdataclass_t rdclass,
}
*cachep = cache;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
cleanup:
cache_destroy(cache);
return (result);
return result;
}
static void
@ -243,7 +243,7 @@ const char *
dns_cache_getname(dns_cache_t *cache) {
REQUIRE(VALID_CACHE(cache));
return (cache->name);
return cache->name;
}
static void
@ -285,7 +285,7 @@ dns_cache_getcachesize(dns_cache_t *cache) {
size = cache->size;
UNLOCK(&cache->lock);
return (size);
return size;
}
void
@ -311,7 +311,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
@ -333,7 +333,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;
}
isc_result_t
@ -345,7 +345,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;
}
LOCK(&cache->lock);
@ -363,7 +363,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
@ -374,7 +374,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;
@ -397,7 +397,7 @@ clearnode(dns_db_t *db, dns_dbnode_t *node) {
}
dns_rdatasetiter_destroy(&iter);
return (result);
return result;
}
static isc_result_t
@ -472,12 +472,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
@ -487,7 +487,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);
@ -496,7 +496,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) {
@ -516,13 +516,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
@ -668,7 +668,7 @@ renderstat(const char *name, uint64_t value, xmlTextWriterPtr writer) {
TRY0(xmlTextWriterEndElement(writer)); /* counter */
error:
return (xmlrc);
return xmlrc;
}
int
@ -707,7 +707,7 @@ dns_cache_renderxml(dns_cache_t *cache, void *writer0) {
TRY0(renderstat("HeapMemInUse", isc_mem_inuse(cache->hmctx), writer));
error:
return (xmlrc);
return xmlrc;
}
#endif /* ifdef HAVE_LIBXML2 */
@ -785,6 +785,6 @@ dns_cache_renderjson(dns_cache_t *cache, void *cstats0) {
result = ISC_R_SUCCESS;
error:
return (result);
return result;
}
#endif /* ifdef HAVE_JSON_C */

View file

@ -253,7 +253,7 @@ catz_coo_new(isc_mem_t *mctx, const dns_name_t *domain) {
dns_name_dup(domain, mctx, &ncoo->name);
isc_refcount_init(&ncoo->references, 1);
return (ncoo);
return ncoo;
}
static void
@ -312,13 +312,13 @@ dns_catz_entry_new(isc_mem_t *mctx, const dns_name_t *domain) {
dns_catz_options_init(&nentry->opts);
isc_refcount_init(&nentry->references, 1);
return (nentry);
return nentry;
}
dns_name_t *
dns_catz_entry_getname(dns_catz_entry_t *entry) {
REQUIRE(DNS_CATZ_ENTRY_VALID(entry));
return (&entry->name);
return &entry->name;
}
dns_catz_entry_t *
@ -331,7 +331,7 @@ dns_catz_entry_copy(dns_catz_zone_t *catz, const dns_catz_entry_t *entry) {
dns_catz_options_copy(catz->catzs->mctx, &entry->opts, &nentry->opts);
return (nentry);
return nentry;
}
void
@ -369,7 +369,7 @@ dns_catz_entry_validate(const dns_catz_entry_t *entry) {
REQUIRE(DNS_CATZ_ENTRY_VALID(entry));
UNUSED(entry);
return (true);
return true;
}
bool
@ -380,24 +380,24 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
REQUIRE(DNS_CATZ_ENTRY_VALID(eb));
if (ea == eb) {
return (true);
return true;
}
if (ea->opts.masters.count != eb->opts.masters.count) {
return (false);
return false;
}
if (memcmp(ea->opts.masters.addrs, eb->opts.masters.addrs,
ea->opts.masters.count * sizeof(isc_sockaddr_t)))
{
return (false);
return false;
}
for (size_t i = 0; i < eb->opts.masters.count; i++) {
if ((ea->opts.masters.keys[i] == NULL) !=
(eb->opts.masters.keys[i] == NULL))
{
return (false);
return false;
}
if (ea->opts.masters.keys[i] == NULL) {
continue;
@ -405,7 +405,7 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
if (!dns_name_equal(ea->opts.masters.keys[i],
eb->opts.masters.keys[i]))
{
return (false);
return false;
}
}
@ -413,7 +413,7 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
if ((ea->opts.masters.tlss[i] == NULL) !=
(eb->opts.masters.tlss[i] == NULL))
{
return (false);
return false;
}
if (ea->opts.masters.tlss[i] == NULL) {
continue;
@ -421,13 +421,13 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
if (!dns_name_equal(ea->opts.masters.tlss[i],
eb->opts.masters.tlss[i]))
{
return (false);
return false;
}
}
/* If one is NULL and the other isn't, the entries don't match */
if ((ea->opts.allow_query == NULL) != (eb->opts.allow_query == NULL)) {
return (false);
return false;
}
/* If one is non-NULL, then they both are */
@ -435,7 +435,7 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
isc_buffer_usedregion(ea->opts.allow_query, &ra);
isc_buffer_usedregion(eb->opts.allow_query, &rb);
if (isc_region_compare(&ra, &rb)) {
return (false);
return false;
}
}
@ -443,32 +443,32 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
if ((ea->opts.allow_transfer == NULL) !=
(eb->opts.allow_transfer == NULL))
{
return (false);
return false;
}
if (ea->opts.allow_transfer != NULL) {
isc_buffer_usedregion(ea->opts.allow_transfer, &ra);
isc_buffer_usedregion(eb->opts.allow_transfer, &rb);
if (isc_region_compare(&ra, &rb)) {
return (false);
return false;
}
}
return (true);
return true;
}
dns_name_t *
dns_catz_zone_getname(dns_catz_zone_t *catz) {
REQUIRE(DNS_CATZ_ZONE_VALID(catz));
return (&catz->name);
return &catz->name;
}
dns_catz_options_t *
dns_catz_zone_getdefoptions(dns_catz_zone_t *catz) {
REQUIRE(DNS_CATZ_ZONE_VALID(catz));
return (&catz->defoptions);
return &catz->defoptions;
}
void
@ -778,7 +778,7 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
UNLOCK(&catz->lock);
return (result);
return result;
}
dns_catz_zones_t *
@ -798,14 +798,14 @@ dns_catz_zones_new(isc_mem_t *mctx, isc_loopmgr_t *loopmgr,
isc_ht_init(&catzs->zones, mctx, 4, ISC_HT_CASE_SENSITIVE);
isc_mem_attach(mctx, &catzs->mctx);
return (catzs);
return catzs;
}
void *
dns_catz_zones_get_udata(dns_catz_zones_t *catzs) {
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
return (catzs->zmm->udata);
return catzs->zmm->udata;
}
void
@ -844,7 +844,7 @@ dns_catz_zone_new(dns_catz_zones_t *catzs, const dns_name_t *name) {
dns_name_init(&catz->name, NULL);
dns_name_dup(name, catzs->mctx, &catz->name);
return (catz);
return catz;
}
static void
@ -939,7 +939,7 @@ dns_catz_zone_add(dns_catz_zones_t *catzs, const dns_name_t *name,
*catzp = catz;
return (result);
return result;
}
dns_catz_zone_t *
@ -953,16 +953,16 @@ dns_catz_zone_get(dns_catz_zones_t *catzs, const dns_name_t *name) {
LOCK(&catzs->lock);
if (catzs->zones == NULL) {
UNLOCK(&catzs->lock);
return (NULL);
return NULL;
}
result = isc_ht_find(catzs->zones, name->ndata, name->length,
(void **)&found);
UNLOCK(&catzs->lock);
if (result != ISC_R_SUCCESS) {
return (NULL);
return NULL;
}
return (found);
return found;
}
static void
@ -1117,32 +1117,32 @@ catz_opt_cmp(const dns_label_t *option, const char *opt) {
if (option->length - 1 == len &&
memcmp(opt, option->base + 1, len) == 0)
{
return (true);
return true;
} else {
return (false);
return false;
}
}
static catz_opt_t
catz_get_option(const dns_label_t *option) {
if (catz_opt_cmp(option, "ext")) {
return (CATZ_OPT_EXT);
return CATZ_OPT_EXT;
} else if (catz_opt_cmp(option, "zones")) {
return (CATZ_OPT_ZONES);
return CATZ_OPT_ZONES;
} else if (catz_opt_cmp(option, "masters") ||
catz_opt_cmp(option, "primaries"))
{
return (CATZ_OPT_PRIMARIES);
return CATZ_OPT_PRIMARIES;
} else if (catz_opt_cmp(option, "allow-query")) {
return (CATZ_OPT_ALLOW_QUERY);
return CATZ_OPT_ALLOW_QUERY;
} else if (catz_opt_cmp(option, "allow-transfer")) {
return (CATZ_OPT_ALLOW_TRANSFER);
return CATZ_OPT_ALLOW_TRANSFER;
} else if (catz_opt_cmp(option, "coo")) {
return (CATZ_OPT_COO);
return CATZ_OPT_COO;
} else if (catz_opt_cmp(option, "version")) {
return (CATZ_OPT_VERSION);
return CATZ_OPT_VERSION;
} else {
return (CATZ_OPT_NONE);
return CATZ_OPT_NONE;
}
}
@ -1157,18 +1157,17 @@ catz_process_zones(dns_catz_zone_t *catz, dns_rdataset_t *value,
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
if (name->labels == 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
dns_name_getlabel(name, name->labels - 1, &mhash);
if (name->labels == 1) {
return (catz_process_zones_entry(catz, value, &mhash));
return catz_process_zones_entry(catz, value, &mhash);
} else {
dns_name_init(&opt, NULL);
dns_name_split(name, 1, &opt, NULL);
return (catz_process_zones_suboption(catz, value, &mhash,
&opt));
return catz_process_zones_suboption(catz, value, &mhash, &opt);
}
}
@ -1186,11 +1185,11 @@ catz_process_coo(dns_catz_zone_t *catz, dns_label_t *mhash,
/* Change of Ownership was introduced in version "2" of the schema. */
if (catz->version < 2) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
if (value->type != dns_rdatatype_ptr) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
if (dns_rdataset_count(value) != 1) {
@ -1199,12 +1198,12 @@ catz_process_coo(dns_catz_zone_t *catz, dns_label_t *mhash,
"catz: 'coo' property PTR RRset contains "
"more than one record, which is invalid");
catz->broken = true;
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
result = dns_rdataset_first(value);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
dns_rdata_init(&rdata);
@ -1212,7 +1211,7 @@ catz_process_coo(dns_catz_zone_t *catz, dns_label_t *mhash,
result = dns_rdata_tostruct(&rdata, &ptr, NULL);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
if (dns_name_countlabels(&ptr.ptr) == 0) {
@ -1237,7 +1236,7 @@ catz_process_coo(dns_catz_zone_t *catz, dns_label_t *mhash,
cleanup:
dns_rdata_freestruct(&ptr);
return (result);
return result;
}
static isc_result_t
@ -1249,7 +1248,7 @@ catz_process_zones_entry(dns_catz_zone_t *catz, dns_rdataset_t *value,
dns_catz_entry_t *entry = NULL;
if (value->type != dns_rdatatype_ptr) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
if (dns_rdataset_count(value) != 1) {
@ -1258,12 +1257,12 @@ catz_process_zones_entry(dns_catz_zone_t *catz, dns_rdataset_t *value,
"catz: member zone PTR RRset contains "
"more than one record, which is invalid");
catz->broken = true;
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
result = dns_rdataset_first(value);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
dns_rdata_init(&rdata);
@ -1271,7 +1270,7 @@ catz_process_zones_entry(dns_catz_zone_t *catz, dns_rdataset_t *value,
result = dns_rdata_tostruct(&rdata, &ptr, NULL);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
result = isc_ht_find(catz->entries, mhash->base, mhash->length,
@ -1280,7 +1279,7 @@ catz_process_zones_entry(dns_catz_zone_t *catz, dns_rdataset_t *value,
if (dns_name_countlabels(&entry->name) != 0) {
/* We have a duplicate. */
dns_rdata_freestruct(&ptr);
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
} else {
dns_name_dup(&ptr.ptr, catz->catzs->mctx, &entry->name);
}
@ -1294,7 +1293,7 @@ catz_process_zones_entry(dns_catz_zone_t *catz, dns_rdataset_t *value,
dns_rdata_freestruct(&ptr);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -1310,7 +1309,7 @@ catz_process_version(dns_catz_zone_t *catz, dns_rdataset_t *value) {
REQUIRE(DNS_RDATASET_VALID(value));
if (value->type != dns_rdatatype_txt) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
if (dns_rdataset_count(value) != 1) {
@ -1319,12 +1318,12 @@ catz_process_version(dns_catz_zone_t *catz, dns_rdataset_t *value) {
"catz: 'version' property TXT RRset contains "
"more than one record, which is invalid");
catz->broken = true;
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
result = dns_rdataset_first(value);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
dns_rdata_init(&rdata);
@ -1332,7 +1331,7 @@ catz_process_version(dns_catz_zone_t *catz, dns_rdataset_t *value) {
result = dns_rdata_tostruct(&rdata, &rdatatxt, NULL);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
result = dns_rdata_txt_first(&rdatatxt);
@ -1372,7 +1371,7 @@ cleanup:
"zone version property");
catz->broken = true;
}
return (result);
return result;
}
static isc_result_t
@ -1441,19 +1440,19 @@ catz_process_primaries(dns_catz_zone_t *catz, dns_ipkeylist_t *ipkl,
result = dns_rdata_txt_first(&rdata_txt);
if (result != ISC_R_SUCCESS) {
dns_rdata_freestruct(&rdata_txt);
return (result);
return result;
}
result = dns_rdata_txt_current(&rdata_txt, &rdatastr);
if (result != ISC_R_SUCCESS) {
dns_rdata_freestruct(&rdata_txt);
return (result);
return result;
}
result = dns_rdata_txt_next(&rdata_txt);
if (result != ISC_R_NOMORE) {
dns_rdata_freestruct(&rdata_txt);
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
/* rdatastr.length < DNS_NAME_MAXTEXT */
@ -1467,11 +1466,11 @@ catz_process_primaries(dns_catz_zone_t *catz, dns_ipkeylist_t *ipkl,
if (result != ISC_R_SUCCESS) {
dns_name_free(keyname, mctx);
isc_mem_put(mctx, keyname, sizeof(*keyname));
return (result);
return result;
}
break;
default:
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
/*
@ -1497,7 +1496,7 @@ catz_process_primaries(dns_catz_zone_t *catz, dns_ipkeylist_t *ipkl,
} else {
result = dns_ipkeylist_resize(mctx, ipkl, i + 1);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
ipkl->labels[i] = isc_mem_get(mctx,
@ -1513,20 +1512,20 @@ catz_process_primaries(dns_catz_zone_t *catz, dns_ipkeylist_t *ipkl,
}
ipkl->count++;
}
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
/* else - 'simple' case - without labels */
if (value->type != dns_rdatatype_a && value->type != dns_rdatatype_aaaa)
{
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
rcount = dns_rdataset_count(value) + ipkl->count;
result = dns_ipkeylist_resize(mctx, ipkl, rcount);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
for (result = dns_rdataset_first(value); result == ISC_R_SUCCESS;
@ -1554,7 +1553,7 @@ catz_process_primaries(dns_catz_zone_t *catz, dns_ipkeylist_t *ipkl,
ipkl->labels[ipkl->count] = NULL;
ipkl->count++;
}
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@ -1575,7 +1574,7 @@ catz_process_apl(dns_catz_zone_t *catz, isc_buffer_t **aclbp,
REQUIRE(dns_rdataset_isassociated(value));
if (value->type != dns_rdatatype_apl) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
if (dns_rdataset_count(value) > 1) {
@ -1590,7 +1589,7 @@ catz_process_apl(dns_catz_zone_t *catz, isc_buffer_t **aclbp,
dns_rdataset_current(value, &rdata);
result = dns_rdata_tostruct(&rdata, &rdata_apl, catz->catzs->mctx);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
isc_buffer_allocate(catz->catzs->mctx, &aclb, 16);
for (result = dns_rdata_apl_first(&rdata_apl); result == ISC_R_SUCCESS;
@ -1635,7 +1634,7 @@ cleanup:
isc_buffer_free(&aclb);
}
dns_rdata_freestruct(&rdata_apl);
return (result);
return result;
}
static isc_result_t
@ -1654,7 +1653,7 @@ catz_process_zones_suboption(dns_catz_zone_t *catz, dns_rdataset_t *value,
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
if (name->labels < 1) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
dns_name_getlabel(name, name->labels - 1, &option);
opt = catz_get_option(&option);
@ -1665,7 +1664,7 @@ catz_process_zones_suboption(dns_catz_zone_t *catz, dns_rdataset_t *value,
*/
if (catz->version >= 2 && opt >= CATZ_OPT_CUSTOM_START) {
if (opt != CATZ_OPT_EXT || name->labels < 2) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
suffix_labels++;
dns_name_getlabel(name, name->labels - 2, &option);
@ -1689,27 +1688,26 @@ catz_process_zones_suboption(dns_catz_zone_t *catz, dns_rdataset_t *value,
dns_name_split(name, suffix_labels, &prefix, NULL);
switch (opt) {
case CATZ_OPT_COO:
return (catz_process_coo(catz, mhash, value));
return catz_process_coo(catz, mhash, value);
case CATZ_OPT_PRIMARIES:
return (catz_process_primaries(catz, &entry->opts.masters,
value, &prefix));
return catz_process_primaries(catz, &entry->opts.masters, value,
&prefix);
case CATZ_OPT_ALLOW_QUERY:
if (prefix.labels != 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
return (catz_process_apl(catz, &entry->opts.allow_query,
value));
return catz_process_apl(catz, &entry->opts.allow_query, value);
case CATZ_OPT_ALLOW_TRANSFER:
if (prefix.labels != 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
return (catz_process_apl(catz, &entry->opts.allow_transfer,
value));
return catz_process_apl(catz, &entry->opts.allow_transfer,
value);
default:
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
static void
@ -1745,7 +1743,7 @@ catz_process_value(dns_catz_zone_t *catz, dns_name_t *name,
REQUIRE(DNS_RDATASET_VALID(rdataset));
if (name->labels < 1) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
dns_name_getlabel(name, name->labels - 1, &option);
opt = catz_get_option(&option);
@ -1756,7 +1754,7 @@ catz_process_value(dns_catz_zone_t *catz, dns_name_t *name,
*/
if (catz->version >= 2 && opt >= CATZ_OPT_CUSTOM_START) {
if (opt != CATZ_OPT_EXT || name->labels < 2) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
suffix_labels++;
dns_name_getlabel(name, name->labels - 2, &option);
@ -1768,29 +1766,29 @@ catz_process_value(dns_catz_zone_t *catz, dns_name_t *name,
switch (opt) {
case CATZ_OPT_ZONES:
return (catz_process_zones(catz, rdataset, &prefix));
return catz_process_zones(catz, rdataset, &prefix);
case CATZ_OPT_PRIMARIES:
return (catz_process_primaries(catz, &catz->zoneoptions.masters,
rdataset, &prefix));
return catz_process_primaries(catz, &catz->zoneoptions.masters,
rdataset, &prefix);
case CATZ_OPT_ALLOW_QUERY:
if (prefix.labels != 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
return (catz_process_apl(catz, &catz->zoneoptions.allow_query,
rdataset));
return catz_process_apl(catz, &catz->zoneoptions.allow_query,
rdataset);
case CATZ_OPT_ALLOW_TRANSFER:
if (prefix.labels != 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
return (catz_process_apl(
catz, &catz->zoneoptions.allow_transfer, rdataset));
return catz_process_apl(catz, &catz->zoneoptions.allow_transfer,
rdataset);
case CATZ_OPT_VERSION:
if (prefix.labels != 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
return (catz_process_version(catz, rdataset));
return catz_process_version(catz, rdataset);
default:
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
}
@ -1822,7 +1820,7 @@ dns__catz_update_process(dns_catz_zone_t *catz, const dns_name_t *src_name,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"catz: RR found which has a non-IN class");
catz->broken = true;
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
nrres = dns_name_fullcompare(src_name, &catz->name, &order, &nlabels);
@ -1830,7 +1828,7 @@ dns__catz_update_process(dns_catz_zone_t *catz, const dns_name_t *src_name,
if (rdataset->type == dns_rdatatype_soa) {
result = dns_rdataset_first(rdataset);
if (result != ISC_R_SUCCESS) {
return (result);
return result;
}
dns_rdataset_current(rdataset, &rdata);
@ -1841,21 +1839,21 @@ dns__catz_update_process(dns_catz_zone_t *catz, const dns_name_t *src_name,
* xxxwpk TODO do we want to save something from SOA?
*/
dns_rdata_freestruct(&soa);
return (result);
return result;
} else if (rdataset->type == dns_rdatatype_ns) {
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
} else {
return (ISC_R_UNEXPECTED);
return ISC_R_UNEXPECTED;
}
} else if (nrres != dns_namereln_subdomain) {
return (ISC_R_UNEXPECTED);
return ISC_R_UNEXPECTED;
}
dns_name_init(&prefix, NULL);
dns_name_split(src_name, catz->name.labels, &prefix, NULL);
result = catz_process_value(catz, &prefix, rdataset);
return (result);
return result;
}
static isc_result_t
@ -1866,10 +1864,10 @@ digest2hex(unsigned char *digest, unsigned int digestlen, char *hash,
size_t left = hashlen - i * 2;
int ret = snprintf(hash + i * 2, left, "%02x", digest[i]);
if (ret < 0 || (size_t)ret >= left) {
return (ISC_R_NOSPACE);
return ISC_R_NOSPACE;
}
}
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
isc_result_t
@ -1958,7 +1956,7 @@ dns_catz_generate_masterfilename(dns_catz_zone_t *catz, dns_catz_entry_t *entry,
cleanup:
isc_buffer_free(&tbuf);
return (result);
return result;
}
/*
@ -2068,11 +2066,11 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *catz, dns_catz_entry_t *entry,
isc_buffer_putstr(buffer, "};");
*buf = buffer;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
cleanup:
isc_buffer_free(&buffer);
return (result);
return result;
}
static void
@ -2141,7 +2139,7 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
catzs = (dns_catz_zones_t *)fn_arg;
if (atomic_load(&catzs->shuttingdown)) {
return (ISC_R_SHUTTINGDOWN);
return ISC_R_SHUTTINGDOWN;
}
dns_name_toregion(&db->origin, &r);
@ -2195,7 +2193,7 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
cleanup:
UNLOCK(&catzs->lock);
return (result);
return result;
}
void
@ -2216,8 +2214,8 @@ dns_catz_dbupdate_register(dns_db_t *db, dns_catz_zones_t *catzs) {
static bool
catz_rdatatype_is_processable(const dns_rdatatype_t type) {
return (!dns_rdatatype_isdnssec(type) && type != dns_rdatatype_cds &&
type != dns_rdatatype_cdnskey && type != dns_rdatatype_zonemd);
return !dns_rdatatype_isdnssec(type) && type != dns_rdatatype_cds &&
type != dns_rdatatype_cdnskey && type != dns_rdatatype_zonemd;
}
/*

Some files were not shown because too many files have changed in this diff Show more