mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-24 07:41:10 -04:00
4074. [cleanup] Cleaned up more warnings from gcc -Wshadow. [RT #38708]
This commit is contained in:
parent
c10fda07d6
commit
af669cb4fd
27 changed files with 210 additions and 207 deletions
2
CHANGES
2
CHANGES
|
|
@ -1,3 +1,5 @@
|
|||
4074. [cleanup] Cleaned up more warnings from gcc -Wshadow. [RT #38708]
|
||||
|
||||
4073. [cleanup] Add libjson-c version number reporting to
|
||||
"named -V"; normalize version number formatting.
|
||||
[RT #38056]
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ main(int argc, char **argv) {
|
|||
int dbits = 0;
|
||||
dns_ttl_t ttl = 0;
|
||||
isc_boolean_t use_default = ISC_FALSE, use_nsec3 = ISC_FALSE;
|
||||
isc_stdtime_t publish = 0, activate = 0, revoke = 0;
|
||||
isc_stdtime_t publish = 0, activate = 0, revokekey = 0;
|
||||
isc_stdtime_t inactive = 0, delete = 0;
|
||||
isc_stdtime_t now;
|
||||
int prepub = -1;
|
||||
|
|
@ -427,7 +427,7 @@ main(int argc, char **argv) {
|
|||
if (setrev || unsetrev)
|
||||
fatal("-R specified more than once");
|
||||
|
||||
revoke = strtotime(isc_commandline_argument,
|
||||
revokekey = strtotime(isc_commandline_argument,
|
||||
now, now, &setrev);
|
||||
unsetrev = !setrev;
|
||||
break;
|
||||
|
|
@ -956,7 +956,7 @@ main(int argc, char **argv) {
|
|||
"was used. Revoking a ZSK is "
|
||||
"legal, but undefined.\n",
|
||||
program);
|
||||
dst_key_settime(key, DST_TIME_REVOKE, revoke);
|
||||
dst_key_settime(key, DST_TIME_REVOKE, revokekey);
|
||||
}
|
||||
|
||||
if (setinact)
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ main(int argc, char **argv) {
|
|||
isc_uint32_t flags;
|
||||
isc_buffer_t buf;
|
||||
isc_boolean_t force = ISC_FALSE;
|
||||
isc_boolean_t remove = ISC_FALSE;
|
||||
isc_boolean_t removefile = ISC_FALSE;
|
||||
isc_boolean_t id = ISC_FALSE;
|
||||
|
||||
if (argc == 1)
|
||||
|
|
@ -133,7 +133,7 @@ main(int argc, char **argv) {
|
|||
}
|
||||
break;
|
||||
case 'r':
|
||||
remove = ISC_TRUE;
|
||||
removefile = ISC_TRUE;
|
||||
break;
|
||||
case 'R':
|
||||
id = ISC_TRUE;
|
||||
|
|
@ -257,7 +257,7 @@ main(int argc, char **argv) {
|
|||
* Remove old key file, if told to (and if
|
||||
* it isn't the same as the new file)
|
||||
*/
|
||||
if (remove && dst_key_alg(key) != DST_ALG_RSAMD5) {
|
||||
if (removefile && dst_key_alg(key) != DST_ALG_RSAMD5) {
|
||||
isc_buffer_init(&buf, oldname, sizeof(oldname));
|
||||
dst_key_setflags(key, flags & ~DNS_KEYFLAG_REVOKE);
|
||||
dst_key_buildfilename(key, DST_TYPE_PRIVATE, dir, &buf);
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ printtime(dst_key_t *key, int type, const char *tag, isc_boolean_t epoch,
|
|||
} else if (epoch) {
|
||||
fprintf(stream, "%d\n", (int) when);
|
||||
} else {
|
||||
time_t time = when;
|
||||
output = ctime(&time);
|
||||
time_t timet = when;
|
||||
output = ctime(&timet);
|
||||
fprintf(stream, "%s", output);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1327,7 +1327,7 @@ cleanup:
|
|||
* Delete any RRSIG records at a node.
|
||||
*/
|
||||
static void
|
||||
cleannode(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node) {
|
||||
cleannode(dns_db_t *db, dns_dbversion_t *dbversion, dns_dbnode_t *node) {
|
||||
dns_rdatasetiter_t *rdsiter = NULL;
|
||||
dns_rdataset_t set;
|
||||
isc_result_t result, dresult;
|
||||
|
|
@ -1336,7 +1336,7 @@ cleannode(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node) {
|
|||
return;
|
||||
|
||||
dns_rdataset_init(&set);
|
||||
result = dns_db_allrdatasets(db, node, version, 0, &rdsiter);
|
||||
result = dns_db_allrdatasets(db, node, dbversion, 0, &rdsiter);
|
||||
check_result(result, "dns_db_allrdatasets");
|
||||
result = dns_rdatasetiter_first(rdsiter);
|
||||
while (result == ISC_R_SUCCESS) {
|
||||
|
|
@ -1350,7 +1350,7 @@ cleannode(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node) {
|
|||
dns_rdataset_disassociate(&set);
|
||||
result = dns_rdatasetiter_next(rdsiter);
|
||||
if (destroy) {
|
||||
dresult = dns_db_deleterdataset(db, node, version,
|
||||
dresult = dns_db_deleterdataset(db, node, dbversion,
|
||||
dns_rdatatype_rrsig,
|
||||
covers);
|
||||
check_result(dresult, "dns_db_deleterdataset");
|
||||
|
|
@ -2783,7 +2783,7 @@ writeset(const char *prefix, dns_rdatatype_t type) {
|
|||
char *filename;
|
||||
char namestr[DNS_NAME_FORMATSIZE];
|
||||
dns_db_t *db = NULL;
|
||||
dns_dbversion_t *version = NULL;
|
||||
dns_dbversion_t *dbversion = NULL;
|
||||
dns_diff_t diff;
|
||||
dns_difftuple_t *tuple = NULL;
|
||||
dns_fixedname_t fixed;
|
||||
|
|
@ -2906,19 +2906,19 @@ writeset(const char *prefix, dns_rdatatype_t type) {
|
|||
gclass, 0, NULL, &db);
|
||||
check_result(result, "dns_db_create");
|
||||
|
||||
result = dns_db_newversion(db, &version);
|
||||
result = dns_db_newversion(db, &dbversion);
|
||||
check_result(result, "dns_db_newversion");
|
||||
|
||||
result = dns_diff_apply(&diff, db, version);
|
||||
result = dns_diff_apply(&diff, db, dbversion);
|
||||
check_result(result, "dns_diff_apply");
|
||||
dns_diff_clear(&diff);
|
||||
|
||||
result = dns_master_dump(mctx, db, version, style, filename);
|
||||
result = dns_master_dump(mctx, db, dbversion, style, filename);
|
||||
check_result(result, "dns_master_dump");
|
||||
|
||||
isc_mem_put(mctx, filename, filenamelen + 1);
|
||||
|
||||
dns_db_closeversion(db, &version, ISC_FALSE);
|
||||
dns_db_closeversion(db, &dbversion, ISC_FALSE);
|
||||
dns_db_detach(&db);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ static void ns_client_dumpmessage(ns_client_t *client, const char *reason);
|
|||
static isc_result_t get_client(ns_clientmgr_t *manager, ns_interface_t *ifp,
|
||||
dns_dispatch_t *disp, isc_boolean_t tcp);
|
||||
static isc_result_t get_worker(ns_clientmgr_t *manager, ns_interface_t *ifp,
|
||||
isc_socket_t *socket);
|
||||
isc_socket_t *sock);
|
||||
static inline isc_boolean_t
|
||||
allowed(isc_netaddr_t *addr, dns_name_t *signer, isc_netaddr_t *ecs_addr,
|
||||
isc_uint8_t ecs_addrlen, isc_uint8_t *ecs_scope, dns_acl_t *acl);
|
||||
|
|
@ -346,12 +346,12 @@ exit_check(ns_client_t *client) {
|
|||
* We are trying to abort request processing.
|
||||
*/
|
||||
if (client->nsends > 0) {
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
if (TCP_CLIENT(client))
|
||||
socket = client->tcpsocket;
|
||||
sock = client->tcpsocket;
|
||||
else
|
||||
socket = client->udpsocket;
|
||||
isc_socket_cancel(socket, client->task,
|
||||
sock = client->udpsocket;
|
||||
isc_socket_cancel(sock, client->task,
|
||||
ISC_SOCKCANCEL_SEND);
|
||||
}
|
||||
|
||||
|
|
@ -875,17 +875,17 @@ client_sendpkg(ns_client_t *client, isc_buffer_t *buffer) {
|
|||
isc_result_t result;
|
||||
isc_region_t r;
|
||||
isc_sockaddr_t *address;
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
isc_netaddr_t netaddr;
|
||||
int match;
|
||||
unsigned int sockflags = ISC_SOCKFLAG_IMMEDIATE;
|
||||
isc_dscp_t dispdscp = -1;
|
||||
|
||||
if (TCP_CLIENT(client)) {
|
||||
socket = client->tcpsocket;
|
||||
sock = client->tcpsocket;
|
||||
address = NULL;
|
||||
} else {
|
||||
socket = client->udpsocket;
|
||||
sock = client->udpsocket;
|
||||
address = &client->peeraddr;
|
||||
|
||||
isc_netaddr_fromsockaddr(&netaddr, &client->peeraddr);
|
||||
|
|
@ -923,7 +923,7 @@ client_sendpkg(ns_client_t *client, isc_buffer_t *buffer) {
|
|||
|
||||
CTRACE("sendto");
|
||||
|
||||
result = isc_socket_sendto2(socket, &r, client->task,
|
||||
result = isc_socket_sendto2(sock, &r, client->task,
|
||||
address, pktinfo,
|
||||
client->sendevent, sockflags);
|
||||
if (result == ISC_R_SUCCESS || result == ISC_R_INPROGRESS) {
|
||||
|
|
@ -3243,7 +3243,7 @@ get_client(ns_clientmgr_t *manager, ns_interface_t *ifp,
|
|||
}
|
||||
|
||||
static isc_result_t
|
||||
get_worker(ns_clientmgr_t *manager, ns_interface_t *ifp, isc_socket_t *socket)
|
||||
get_worker(ns_clientmgr_t *manager, ns_interface_t *ifp, isc_socket_t *sock)
|
||||
{
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
isc_event_t *ev;
|
||||
|
|
@ -3291,7 +3291,7 @@ get_worker(ns_clientmgr_t *manager, ns_interface_t *ifp, isc_socket_t *socket)
|
|||
client->pipelined = ISC_TRUE;
|
||||
|
||||
isc_socket_attach(ifp->tcpsocket, &client->tcplistener);
|
||||
isc_socket_attach(socket, &client->tcpsocket);
|
||||
isc_socket_attach(sock, &client->tcpsocket);
|
||||
isc_socket_setname(client->tcpsocket, "worker-tcp", NULL);
|
||||
(void)isc_socket_getpeername(client->tcpsocket, &client->peeraddr);
|
||||
client->peeraddr_valid = ISC_TRUE;
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
|||
const char *category, const char **desc, int ncounters,
|
||||
int *indices, isc_uint64_t *values, int options)
|
||||
{
|
||||
int i, index;
|
||||
int i, idx;
|
||||
isc_uint64_t value;
|
||||
stats_dumparg_t dumparg;
|
||||
FILE *fp;
|
||||
|
|
@ -611,8 +611,8 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
|||
#endif
|
||||
|
||||
for (i = 0; i < ncounters; i++) {
|
||||
index = indices[i];
|
||||
value = values[index];
|
||||
idx = indices[i];
|
||||
value = values[idx];
|
||||
|
||||
if (value == 0 && (options & ISC_STATSDUMP_VERBOSE) == 0)
|
||||
continue;
|
||||
|
|
@ -621,7 +621,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
|||
case isc_statsformat_file:
|
||||
fp = arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
|
||||
value, desc[index]);
|
||||
value, desc[idx]);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
#ifdef HAVE_LIBXML2
|
||||
|
|
@ -639,7 +639,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
|||
"name"));
|
||||
TRY0(xmlTextWriterWriteString(writer,
|
||||
ISC_XMLCHAR
|
||||
desc[index]));
|
||||
desc[idx]));
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
/* </name> */
|
||||
|
||||
|
|
@ -663,7 +663,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
|||
ISC_XMLCHAR
|
||||
"name",
|
||||
ISC_XMLCHAR
|
||||
desc[index]));
|
||||
desc[idx]));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u", value));
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
|
|
@ -677,7 +677,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
|||
counter = json_object_new_int64(value);
|
||||
if (counter == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
json_object_object_add(cat, desc[index], counter);
|
||||
json_object_object_add(cat, desc[idx], counter);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -953,7 +953,7 @@ free_sevent(isc_event_t *ev) {
|
|||
}
|
||||
|
||||
static inline isc_socketevent_t *
|
||||
allocate_sevent(dns_dispatch_t *disp, isc_socket_t *socket,
|
||||
allocate_sevent(dns_dispatch_t *disp, isc_socket_t *sock,
|
||||
isc_eventtype_t type, isc_taskaction_t action, const void *arg)
|
||||
{
|
||||
isc_socketevent_t *ev;
|
||||
|
|
@ -964,7 +964,7 @@ allocate_sevent(dns_dispatch_t *disp, isc_socket_t *socket,
|
|||
return (NULL);
|
||||
DE_CONST(arg, deconst_arg);
|
||||
ISC_EVENT_INIT(ev, sizeof(*ev), 0, NULL, type,
|
||||
action, deconst_arg, socket,
|
||||
action, deconst_arg, sock,
|
||||
free_sevent, disp->sepool);
|
||||
ev->result = ISC_R_UNSET;
|
||||
ISC_LINK_INIT(ev, ev_link);
|
||||
|
|
@ -1503,7 +1503,7 @@ static isc_result_t
|
|||
startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
||||
isc_result_t res;
|
||||
isc_region_t region;
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
|
||||
if (disp->shutting_down == 1)
|
||||
return (ISC_R_SUCCESS);
|
||||
|
|
@ -1522,10 +1522,10 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
|||
return (ISC_R_SUCCESS);
|
||||
|
||||
if (dispsock != NULL)
|
||||
socket = dispsock->socket;
|
||||
sock = dispsock->socket;
|
||||
else
|
||||
socket = disp->socket;
|
||||
INSIST(socket != NULL);
|
||||
sock = disp->socket;
|
||||
INSIST(sock != NULL);
|
||||
|
||||
switch (disp->socktype) {
|
||||
/*
|
||||
|
|
@ -1539,7 +1539,7 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
|||
if (dispsock != NULL) {
|
||||
isc_task_t *dt = dispsock->task;
|
||||
isc_socketevent_t *sev =
|
||||
allocate_sevent(disp, socket,
|
||||
allocate_sevent(disp, sock,
|
||||
ISC_SOCKEVENT_RECVDONE,
|
||||
udp_exrecv, dispsock);
|
||||
if (sev == NULL) {
|
||||
|
|
@ -1547,7 +1547,7 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
|||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
|
||||
res = isc_socket_recv2(socket, ®ion, 1, dt, sev, 0);
|
||||
res = isc_socket_recv2(sock, ®ion, 1, dt, sev, 0);
|
||||
if (res != ISC_R_SUCCESS) {
|
||||
free_buffer(disp, region.base, region.length);
|
||||
return (res);
|
||||
|
|
@ -1555,7 +1555,7 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
|||
} else {
|
||||
isc_task_t *dt = disp->task[0];
|
||||
isc_socketevent_t *sev =
|
||||
allocate_sevent(disp, socket,
|
||||
allocate_sevent(disp, sock,
|
||||
ISC_SOCKEVENT_RECVDONE,
|
||||
udp_shrecv, disp);
|
||||
if (sev == NULL) {
|
||||
|
|
@ -1563,7 +1563,7 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
|||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
|
||||
res = isc_socket_recv2(socket, ®ion, 1, dt, sev, 0);
|
||||
res = isc_socket_recv2(sock, ®ion, 1, dt, sev, 0);
|
||||
if (res != ISC_R_SUCCESS) {
|
||||
free_buffer(disp, region.base, region.length);
|
||||
disp->shutdown_why = res;
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ static void
|
|||
check_config(const char *gss_name) {
|
||||
const char *p;
|
||||
krb5_context krb5_ctx;
|
||||
char *krb5_realm = NULL;
|
||||
char *krb5_realm_name = NULL;
|
||||
|
||||
if (strncasecmp(gss_name, "DNS/", 4) != 0) {
|
||||
gss_log(ISC_LOG_ERROR, "tkey-gssapi-credential (%s) "
|
||||
|
|
@ -228,7 +228,7 @@ check_config(const char *gss_name) {
|
|||
gss_log(ISC_LOG_ERROR, "Unable to initialise krb5 context");
|
||||
return;
|
||||
}
|
||||
if (krb5_get_default_realm(krb5_ctx, &krb5_realm) != 0) {
|
||||
if (krb5_get_default_realm(krb5_ctx, &krb5_realm_name) != 0) {
|
||||
gss_log(ISC_LOG_ERROR, "Unable to get krb5 default realm");
|
||||
krb5_free_context(krb5_ctx);
|
||||
return;
|
||||
|
|
@ -240,10 +240,10 @@ check_config(const char *gss_name) {
|
|||
krb5_free_context(krb5_ctx);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp(p + 1, krb5_realm) != 0) {
|
||||
if (strcasecmp(p + 1, krb5_realm_name) != 0) {
|
||||
gss_log(ISC_LOG_ERROR, "default realm from krb5.conf (%s) "
|
||||
"does not match tkey-gssapi-credential (%s)",
|
||||
krb5_realm, gss_name);
|
||||
krb5_realm_name, gss_name);
|
||||
krb5_free_context(krb5_ctx);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -556,7 +556,7 @@ journal_file_create(isc_mem_t *mctx, const char *filename) {
|
|||
}
|
||||
|
||||
static isc_result_t
|
||||
journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t write,
|
||||
journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t writable,
|
||||
isc_boolean_t create, dns_journal_t **journalp)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
|
|
@ -580,7 +580,7 @@ journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t write,
|
|||
if (j->filename == NULL)
|
||||
FAIL(ISC_R_NOMEMORY);
|
||||
|
||||
result = isc_stdio_open(j->filename, write ? "rb+" : "rb", &fp);
|
||||
result = isc_stdio_open(j->filename, writable ? "rb+" : "rb", &fp);
|
||||
|
||||
if (result == ISC_R_FILENOTFOUND) {
|
||||
if (create) {
|
||||
|
|
@ -670,7 +670,7 @@ journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t write,
|
|||
dns_decompress_init(&j->it.dctx, -1, DNS_DECOMPRESS_NONE);
|
||||
|
||||
j->state =
|
||||
write ? JOURNAL_STATE_WRITE : JOURNAL_STATE_READ;
|
||||
writable ? JOURNAL_STATE_WRITE : JOURNAL_STATE_READ;
|
||||
|
||||
*journalp = j;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
|
@ -697,12 +697,12 @@ dns_journal_open(isc_mem_t *mctx, const char *filename, unsigned int mode,
|
|||
isc_result_t result;
|
||||
size_t namelen;
|
||||
char backup[1024];
|
||||
isc_boolean_t write, create;
|
||||
isc_boolean_t writable, create;
|
||||
|
||||
create = ISC_TF(mode & DNS_JOURNAL_CREATE);
|
||||
write = ISC_TF(mode & (DNS_JOURNAL_WRITE|DNS_JOURNAL_CREATE));
|
||||
writable = ISC_TF(mode & (DNS_JOURNAL_WRITE|DNS_JOURNAL_CREATE));
|
||||
|
||||
result = journal_open(mctx, filename, write, create, journalp);
|
||||
result = journal_open(mctx, filename, writable, create, journalp);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
namelen = strlen(filename);
|
||||
if (namelen > 4U && strcmp(filename + namelen - 4, ".jnl") == 0)
|
||||
|
|
@ -712,7 +712,8 @@ dns_journal_open(isc_mem_t *mctx, const char *filename, unsigned int mode,
|
|||
(int)namelen, filename);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
result = journal_open(mctx, backup, write, write, journalp);
|
||||
result = journal_open(mctx, backup, writable, writable,
|
||||
journalp);
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ dns_private_totext(dns_rdata_t *private, isc_buffer_t *buf) {
|
|||
unsigned char newbuf[DNS_NSEC3PARAM_BUFFERSIZE];
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
dns_rdata_nsec3param_t nsec3param;
|
||||
isc_boolean_t remove, init, nonsec;
|
||||
isc_boolean_t delete, init, nonsec;
|
||||
isc_buffer_t b;
|
||||
|
||||
if (!dns_nsec3param_fromprivate(private, &rdata, nsec3buf,
|
||||
|
|
@ -315,7 +315,7 @@ dns_private_totext(dns_rdata_t *private, isc_buffer_t *buf) {
|
|||
|
||||
CHECK(dns_rdata_tostruct(&rdata, &nsec3param, NULL));
|
||||
|
||||
remove = ISC_TF((nsec3param.flags & DNS_NSEC3FLAG_REMOVE) != 0);
|
||||
delete = ISC_TF((nsec3param.flags & DNS_NSEC3FLAG_REMOVE) != 0);
|
||||
init = ISC_TF((nsec3param.flags & DNS_NSEC3FLAG_INITIAL) != 0);
|
||||
nonsec = ISC_TF((nsec3param.flags & DNS_NSEC3FLAG_NONSEC) != 0);
|
||||
|
||||
|
|
@ -326,7 +326,7 @@ dns_private_totext(dns_rdata_t *private, isc_buffer_t *buf) {
|
|||
|
||||
if (init)
|
||||
isc_buffer_putstr(buf, "Pending NSEC3 chain ");
|
||||
else if (remove)
|
||||
else if (delete)
|
||||
isc_buffer_putstr(buf, "Removing NSEC3 chain ");
|
||||
else
|
||||
isc_buffer_putstr(buf, "Creating NSEC3 chain ");
|
||||
|
|
@ -339,18 +339,18 @@ dns_private_totext(dns_rdata_t *private, isc_buffer_t *buf) {
|
|||
|
||||
CHECK(dns_rdata_totext(&rdata, NULL, buf));
|
||||
|
||||
if (remove && !nonsec)
|
||||
if (delete && !nonsec)
|
||||
isc_buffer_putstr(buf, " / creating NSEC chain");
|
||||
} else if (private->length == 5) {
|
||||
unsigned char alg = private->data[0];
|
||||
dns_keytag_t keyid = (private->data[2] | private->data[1] << 8);
|
||||
char keybuf[BUFSIZ], algbuf[DNS_SECALG_FORMATSIZE];
|
||||
isc_boolean_t remove = ISC_TF(private->data[3] != 0);
|
||||
isc_boolean_t delete = ISC_TF(private->data[3] != 0);
|
||||
isc_boolean_t complete = ISC_TF(private->data[4] != 0);
|
||||
|
||||
if (remove && complete)
|
||||
if (delete && complete)
|
||||
isc_buffer_putstr(buf, "Done removing signatures for ");
|
||||
else if (remove)
|
||||
else if (delete)
|
||||
isc_buffer_putstr(buf, "Removing signatures for ");
|
||||
else if (complete)
|
||||
isc_buffer_putstr(buf, "Done signing with ");
|
||||
|
|
|
|||
|
|
@ -839,7 +839,7 @@ typedef struct rbtdb_dbiterator {
|
|||
|
||||
static void free_rbtdb(dns_rbtdb_t *rbtdb, isc_boolean_t log,
|
||||
isc_event_t *event);
|
||||
static void overmem(dns_db_t *db, isc_boolean_t overmem);
|
||||
static void overmem(dns_db_t *db, isc_boolean_t over);
|
||||
static void setnsec3parameters(dns_db_t *db, rbtdb_version_t *version);
|
||||
|
||||
/* Pad to 32 bytes */
|
||||
|
|
@ -1042,10 +1042,10 @@ resign_sooner(void *v1, void *v2) {
|
|||
* This function sets the heap index into the header.
|
||||
*/
|
||||
static void
|
||||
set_index(void *what, unsigned int index) {
|
||||
set_index(void *what, unsigned int idx) {
|
||||
rdatasetheader_t *h = what;
|
||||
|
||||
h->heap_index = index;
|
||||
h->heap_index = idx;
|
||||
}
|
||||
|
||||
/*%
|
||||
|
|
@ -5591,11 +5591,11 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
|
|||
}
|
||||
|
||||
static void
|
||||
overmem(dns_db_t *db, isc_boolean_t overmem) {
|
||||
overmem(dns_db_t *db, isc_boolean_t over) {
|
||||
/* This is an empty callback. See adb.c:water() */
|
||||
|
||||
UNUSED(db);
|
||||
UNUSED(overmem);
|
||||
UNUSED(over);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ totext_keydata(ARGS_TOTEXT) {
|
|||
char buf[sizeof("64000")];
|
||||
unsigned int flags;
|
||||
unsigned char algorithm;
|
||||
unsigned long refresh, add, remove;
|
||||
unsigned long refresh, add, delete;
|
||||
char algbuf[DNS_NAME_FORMATSIZE];
|
||||
const char *keyinfo;
|
||||
|
||||
|
|
@ -122,9 +122,9 @@ totext_keydata(ARGS_TOTEXT) {
|
|||
RETERR(str_totext(" ", target));
|
||||
|
||||
/* remove hold-down */
|
||||
remove = uint32_fromregion(&sr);
|
||||
delete = uint32_fromregion(&sr);
|
||||
isc_region_consume(&sr, 4);
|
||||
RETERR(dns_time32_totext(remove, target));
|
||||
RETERR(dns_time32_totext(delete, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
|
||||
/* flags */
|
||||
|
|
@ -224,11 +224,11 @@ totext_keydata(ARGS_TOTEXT) {
|
|||
RETERR(str_totext(abuf, target));
|
||||
}
|
||||
|
||||
if (remove != 0U) {
|
||||
if (delete != 0U) {
|
||||
RETERR(str_totext(tctx->linebreak, target));
|
||||
RETERR(str_totext("; removal pending: ",
|
||||
target));
|
||||
isc_time_set(&t, remove, 0);
|
||||
isc_time_set(&t, delete, 0);
|
||||
isc_time_formathttptimestamp(&t, dbuf,
|
||||
sizeof(dbuf));
|
||||
RETERR(str_totext(dbuf, target));
|
||||
|
|
|
|||
|
|
@ -95,16 +95,16 @@ totext_soa(ARGS_TOTEXT) {
|
|||
isc_boolean_t sub;
|
||||
int i;
|
||||
isc_boolean_t multiline;
|
||||
isc_boolean_t comment;
|
||||
isc_boolean_t comm;
|
||||
|
||||
REQUIRE(rdata->type == 6);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
||||
multiline = ISC_TF((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0);
|
||||
if (multiline)
|
||||
comment = ISC_TF((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0);
|
||||
comm = ISC_TF((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0);
|
||||
else
|
||||
comment = ISC_FALSE;
|
||||
comm = ISC_FALSE;
|
||||
|
||||
|
||||
dns_name_init(&mname, NULL);
|
||||
|
|
@ -136,9 +136,9 @@ totext_soa(ARGS_TOTEXT) {
|
|||
unsigned long num;
|
||||
num = uint32_fromregion(&dregion);
|
||||
isc_region_consume(&dregion, 4);
|
||||
sprintf(buf, comment ? "%-10lu ; " : "%lu", num);
|
||||
sprintf(buf, comm ? "%-10lu ; " : "%lu", num);
|
||||
RETERR(str_totext(buf, target));
|
||||
if (comment) {
|
||||
if (comm) {
|
||||
RETERR(str_totext(soa_fieldnames[i], target));
|
||||
/* Print times in week/day/hour/minute/second form */
|
||||
if (i >= 1) {
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ dns_requestmgr_create(isc_mem_t *mctx,
|
|||
dns_requestmgr_t **requestmgrp)
|
||||
{
|
||||
dns_requestmgr_t *requestmgr;
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
isc_result_t result;
|
||||
int i;
|
||||
unsigned int dispattr;
|
||||
|
|
@ -157,7 +157,7 @@ dns_requestmgr_create(isc_mem_t *mctx,
|
|||
REQUIRE(socketmgr != NULL);
|
||||
REQUIRE(taskmgr != NULL);
|
||||
REQUIRE(dispatchmgr != NULL);
|
||||
UNUSED(socket);
|
||||
UNUSED(sock);
|
||||
if (dispatchv4 != NULL) {
|
||||
dispattr = dns_dispatch_getattributes(dispatchv4);
|
||||
REQUIRE((dispattr & DNS_DISPATCHATTR_UDP) != 0);
|
||||
|
|
@ -427,21 +427,21 @@ mgr_gethash(dns_requestmgr_t *requestmgr) {
|
|||
static inline isc_result_t
|
||||
req_send(dns_request_t *request, isc_task_t *task, isc_sockaddr_t *address) {
|
||||
isc_region_t r;
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
isc_socketevent_t *sendevent;
|
||||
isc_result_t result;
|
||||
|
||||
req_log(ISC_LOG_DEBUG(3), "req_send: request %p", request);
|
||||
|
||||
REQUIRE(VALID_REQUEST(request));
|
||||
socket = req_getsocket(request);
|
||||
sock = req_getsocket(request);
|
||||
isc_buffer_usedregion(request->query, &r);
|
||||
/*
|
||||
* We could connect the socket when we are using an exclusive dispatch
|
||||
* as we do in resolver.c, but we prefer implementation simplicity
|
||||
* at this moment.
|
||||
*/
|
||||
sendevent = isc_socket_socketevent(request->mctx, socket,
|
||||
sendevent = isc_socket_socketevent(request->mctx, sock,
|
||||
ISC_SOCKEVENT_SENDDONE,
|
||||
req_senddone, request);
|
||||
if (sendevent == NULL)
|
||||
|
|
@ -454,7 +454,7 @@ req_send(dns_request_t *request, isc_task_t *task, isc_sockaddr_t *address) {
|
|||
sendevent->dscp = request->dscp;
|
||||
}
|
||||
|
||||
result = isc_socket_sendto2(socket, &r, task, address, NULL,
|
||||
result = isc_socket_sendto2(sock, &r, task, address, NULL,
|
||||
sendevent, 0);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
request->flags |= DNS_REQUEST_F_SENDING;
|
||||
|
|
@ -532,7 +532,7 @@ create_tcp_dispatch(isc_boolean_t newtcp, isc_boolean_t share,
|
|||
isc_boolean_t *connected, dns_dispatch_t **dispatchp)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_socket_t *socket = NULL;
|
||||
isc_socket_t *sock = NULL;
|
||||
isc_sockaddr_t src;
|
||||
unsigned int attrs;
|
||||
isc_sockaddr_t bind_any;
|
||||
|
|
@ -566,18 +566,18 @@ create_tcp_dispatch(isc_boolean_t newtcp, isc_boolean_t share,
|
|||
|
||||
result = isc_socket_create(requestmgr->socketmgr,
|
||||
isc_sockaddr_pf(destaddr),
|
||||
isc_sockettype_tcp, &socket);
|
||||
isc_sockettype_tcp, &sock);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
|
||||
if (srcaddr == NULL) {
|
||||
isc_sockaddr_anyofpf(&bind_any,
|
||||
isc_sockaddr_pf(destaddr));
|
||||
result = isc_socket_bind(socket, &bind_any, 0);
|
||||
result = isc_socket_bind(sock, &bind_any, 0);
|
||||
} else {
|
||||
src = *srcaddr;
|
||||
isc_sockaddr_setport(&src, 0);
|
||||
result = isc_socket_bind(socket, &src, 0);
|
||||
result = isc_socket_bind(sock, &src, 0);
|
||||
}
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
|
@ -591,14 +591,14 @@ create_tcp_dispatch(isc_boolean_t newtcp, isc_boolean_t share,
|
|||
attrs |= DNS_DISPATCHATTR_IPV6;
|
||||
attrs |= DNS_DISPATCHATTR_MAKEQUERY;
|
||||
|
||||
isc_socket_dscp(socket, dscp);
|
||||
isc_socket_dscp(sock, dscp);
|
||||
result = dns_dispatch_createtcp2(requestmgr->dispatchmgr,
|
||||
socket, requestmgr->taskmgr,
|
||||
sock, requestmgr->taskmgr,
|
||||
srcaddr, destaddr,
|
||||
4096, 32768, 32768, 16411, 16433,
|
||||
attrs, dispatchp);
|
||||
cleanup:
|
||||
isc_socket_detach(&socket);
|
||||
isc_socket_detach(&sock);
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
|
@ -748,7 +748,7 @@ dns_request_createraw4(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
|||
{
|
||||
dns_request_t *request = NULL;
|
||||
isc_task_t *tclone = NULL;
|
||||
isc_socket_t *socket = NULL;
|
||||
isc_socket_t *sock = NULL;
|
||||
isc_result_t result;
|
||||
isc_mem_t *mctx;
|
||||
dns_messageid_t id;
|
||||
|
|
@ -846,8 +846,8 @@ dns_request_createraw4(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
socket = req_getsocket(request);
|
||||
INSIST(socket != NULL);
|
||||
sock = req_getsocket(request);
|
||||
INSIST(sock != NULL);
|
||||
|
||||
result = isc_buffer_allocate(mctx, &request->query,
|
||||
r.length + (tcp ? 2 : 0));
|
||||
|
|
@ -883,7 +883,7 @@ dns_request_createraw4(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
|||
|
||||
request->destaddr = *destaddr;
|
||||
if (tcp && !connected) {
|
||||
result = isc_socket_connect(socket, destaddr, task,
|
||||
result = isc_socket_connect(sock, destaddr, task,
|
||||
req_connected, request);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto unlink;
|
||||
|
|
@ -983,13 +983,13 @@ dns_request_createvia4(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
|||
{
|
||||
dns_request_t *request = NULL;
|
||||
isc_task_t *tclone = NULL;
|
||||
isc_socket_t *socket = NULL;
|
||||
isc_socket_t *sock = NULL;
|
||||
isc_result_t result;
|
||||
isc_mem_t *mctx;
|
||||
dns_messageid_t id;
|
||||
isc_boolean_t tcp;
|
||||
isc_boolean_t share;
|
||||
isc_boolean_t setkey = ISC_TRUE;
|
||||
isc_boolean_t settsigkey = ISC_TRUE;
|
||||
isc_boolean_t connected = ISC_FALSE;
|
||||
|
||||
REQUIRE(VALID_REQUESTMGR(requestmgr));
|
||||
|
|
@ -1062,11 +1062,11 @@ dns_request_createvia4(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
|||
requestmgr->socketmgr);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
socket = req_getsocket(request);
|
||||
INSIST(socket != NULL);
|
||||
sock = req_getsocket(request);
|
||||
INSIST(sock != NULL);
|
||||
|
||||
message->id = id;
|
||||
if (setkey) {
|
||||
if (settsigkey) {
|
||||
result = dns_message_settsigkey(message, request->tsigkey);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
|
@ -1080,9 +1080,9 @@ dns_request_createvia4(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
|||
dns_message_renderreset(message);
|
||||
dns_dispatch_removeresponse(&request->dispentry, NULL);
|
||||
dns_dispatch_detach(&request->dispatch);
|
||||
socket = NULL;
|
||||
sock = NULL;
|
||||
options |= DNS_REQUESTOPT_TCP;
|
||||
setkey = ISC_FALSE;
|
||||
settsigkey = ISC_FALSE;
|
||||
goto use_tcp;
|
||||
}
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
@ -1109,7 +1109,7 @@ dns_request_createvia4(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
|||
|
||||
request->destaddr = *destaddr;
|
||||
if (tcp && !connected) {
|
||||
result = isc_socket_connect(socket, destaddr, task,
|
||||
result = isc_socket_connect(sock, destaddr, task,
|
||||
req_connected, request);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto unlink;
|
||||
|
|
@ -1352,16 +1352,16 @@ dns_request_destroy(dns_request_t **requestp) {
|
|||
static isc_socket_t *
|
||||
req_getsocket(dns_request_t *request) {
|
||||
unsigned int dispattr;
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
|
||||
dispattr = dns_dispatch_getattributes(request->dispatch);
|
||||
if ((dispattr & DNS_DISPATCHATTR_EXCLUSIVE) != 0) {
|
||||
INSIST(request->dispentry != NULL);
|
||||
socket = dns_dispatch_getentrysocket(request->dispentry);
|
||||
sock = dns_dispatch_getentrysocket(request->dispentry);
|
||||
} else
|
||||
socket = dns_dispatch_getsocket(request->dispatch);
|
||||
sock = dns_dispatch_getsocket(request->dispatch);
|
||||
|
||||
return (socket);
|
||||
return (sock);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1562,7 +1562,7 @@ req_destroy(dns_request_t *request) {
|
|||
*/
|
||||
static void
|
||||
req_cancel(dns_request_t *request) {
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
unsigned int dispattr;
|
||||
|
||||
REQUIRE(VALID_REQUEST(request));
|
||||
|
|
@ -1577,19 +1577,19 @@ req_cancel(dns_request_t *request) {
|
|||
if (request->timer != NULL)
|
||||
isc_timer_detach(&request->timer);
|
||||
dispattr = dns_dispatch_getattributes(request->dispatch);
|
||||
socket = NULL;
|
||||
sock = NULL;
|
||||
if (DNS_REQUEST_CONNECTING(request) || DNS_REQUEST_SENDING(request)) {
|
||||
if ((dispattr & DNS_DISPATCHATTR_EXCLUSIVE) != 0) {
|
||||
if (request->dispentry != NULL) {
|
||||
socket = dns_dispatch_getentrysocket(
|
||||
sock = dns_dispatch_getentrysocket(
|
||||
request->dispentry);
|
||||
}
|
||||
} else
|
||||
socket = dns_dispatch_getsocket(request->dispatch);
|
||||
if (DNS_REQUEST_CONNECTING(request) && socket != NULL)
|
||||
isc_socket_cancel(socket, NULL, ISC_SOCKCANCEL_CONNECT);
|
||||
if (DNS_REQUEST_SENDING(request) && socket != NULL)
|
||||
isc_socket_cancel(socket, NULL, ISC_SOCKCANCEL_SEND);
|
||||
sock = dns_dispatch_getsocket(request->dispatch);
|
||||
if (DNS_REQUEST_CONNECTING(request) && sock != NULL)
|
||||
isc_socket_cancel(sock, NULL, ISC_SOCKCANCEL_CONNECT);
|
||||
if (DNS_REQUEST_SENDING(request) && sock != NULL)
|
||||
isc_socket_cancel(sock, NULL, ISC_SOCKCANCEL_SEND);
|
||||
}
|
||||
if (request->dispentry != NULL)
|
||||
dns_dispatch_removeresponse(&request->dispentry, NULL);
|
||||
|
|
|
|||
|
|
@ -847,7 +847,7 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp,
|
|||
unsigned int factor;
|
||||
dns_adbfind_t *find;
|
||||
dns_adbaddrinfo_t *addrinfo;
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
isc_stdtime_t now;
|
||||
|
||||
query = *queryp;
|
||||
|
|
@ -1001,9 +1001,9 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp,
|
|||
ISC_SOCKCANCEL_CONNECT);
|
||||
} else if (query->dispentry != NULL) {
|
||||
INSIST(query->exclusivesocket);
|
||||
socket = dns_dispatch_getentrysocket(query->dispentry);
|
||||
if (socket != NULL)
|
||||
isc_socket_cancel(socket, NULL,
|
||||
sock = dns_dispatch_getentrysocket(query->dispentry);
|
||||
if (sock != NULL)
|
||||
isc_socket_cancel(sock, NULL,
|
||||
ISC_SOCKCANCEL_CONNECT);
|
||||
}
|
||||
} else if (RESQUERY_SENDING(query)) {
|
||||
|
|
@ -1011,11 +1011,11 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp,
|
|||
* Cancel the pending send.
|
||||
*/
|
||||
if (query->exclusivesocket && query->dispentry != NULL)
|
||||
socket = dns_dispatch_getentrysocket(query->dispentry);
|
||||
sock = dns_dispatch_getentrysocket(query->dispentry);
|
||||
else
|
||||
socket = dns_dispatch_getsocket(query->dispatch);
|
||||
if (socket != NULL)
|
||||
isc_socket_cancel(socket, NULL, ISC_SOCKCANCEL_SEND);
|
||||
sock = dns_dispatch_getsocket(query->dispatch);
|
||||
if (sock != NULL)
|
||||
isc_socket_cancel(sock, NULL, ISC_SOCKCANCEL_SEND);
|
||||
}
|
||||
|
||||
if (query->dispentry != NULL)
|
||||
|
|
@ -1906,7 +1906,7 @@ resquery_send(resquery_t *query) {
|
|||
isc_region_t r;
|
||||
dns_resolver_t *res;
|
||||
isc_task_t *task;
|
||||
isc_socket_t *socket;
|
||||
isc_socket_t *sock;
|
||||
isc_buffer_t tcpbuffer;
|
||||
isc_sockaddr_t *address;
|
||||
isc_buffer_t *buffer;
|
||||
|
|
@ -2312,16 +2312,16 @@ resquery_send(resquery_t *query) {
|
|||
dns_message_reset(fctx->qmessage, DNS_MESSAGE_INTENTRENDER);
|
||||
|
||||
if (query->exclusivesocket)
|
||||
socket = dns_dispatch_getentrysocket(query->dispentry);
|
||||
sock = dns_dispatch_getentrysocket(query->dispentry);
|
||||
else
|
||||
socket = dns_dispatch_getsocket(query->dispatch);
|
||||
sock = dns_dispatch_getsocket(query->dispatch);
|
||||
/*
|
||||
* Send the query!
|
||||
*/
|
||||
if ((query->options & DNS_FETCHOPT_TCP) == 0) {
|
||||
address = &query->addrinfo->sockaddr;
|
||||
if (query->exclusivesocket) {
|
||||
result = isc_socket_connect(socket, address, task,
|
||||
result = isc_socket_connect(sock, address, task,
|
||||
resquery_udpconnected,
|
||||
query);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
@ -2348,10 +2348,10 @@ resquery_send(resquery_t *query) {
|
|||
query->sendevent.attributes |= ISC_SOCKEVENTATTR_DSCP;
|
||||
query->sendevent.dscp = query->dscp;
|
||||
if ((query->options & DNS_FETCHOPT_TCP) != 0)
|
||||
isc_socket_dscp(socket, query->dscp);
|
||||
isc_socket_dscp(sock, query->dscp);
|
||||
}
|
||||
|
||||
result = isc_socket_sendto2(socket, &r, task, address, NULL,
|
||||
result = isc_socket_sendto2(sock, &r, task, address, NULL,
|
||||
&query->sendevent, 0);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
if (connecting) {
|
||||
|
|
@ -2542,7 +2542,7 @@ fctx_finddone(isc_task_t *task, isc_event_t *event) {
|
|||
isc_boolean_t want_done = ISC_FALSE;
|
||||
isc_boolean_t bucket_empty = ISC_FALSE;
|
||||
unsigned int bucketnum;
|
||||
isc_boolean_t destroy = ISC_FALSE;
|
||||
isc_boolean_t dodestroy = ISC_FALSE;
|
||||
|
||||
find = event->ev_sender;
|
||||
fctx = event->ev_arg;
|
||||
|
|
@ -2583,7 +2583,7 @@ fctx_finddone(isc_task_t *task, isc_event_t *event) {
|
|||
|
||||
if (fctx->references == 0) {
|
||||
bucket_empty = fctx_unlink(fctx);
|
||||
destroy = ISC_TRUE;
|
||||
dodestroy = ISC_TRUE;
|
||||
}
|
||||
}
|
||||
UNLOCK(&res->buckets[bucketnum].lock);
|
||||
|
|
@ -2596,7 +2596,7 @@ fctx_finddone(isc_task_t *task, isc_event_t *event) {
|
|||
} else if (want_done) {
|
||||
FCTXTRACE("fetch failed in finddone(); return ISC_R_FAILURE");
|
||||
fctx_done(fctx, ISC_R_FAILURE, __LINE__);
|
||||
} else if (destroy) {
|
||||
} else if (dodestroy) {
|
||||
fctx_destroy(fctx);
|
||||
if (bucket_empty)
|
||||
empty_bucket(res);
|
||||
|
|
@ -3695,7 +3695,7 @@ fctx_doshutdown(isc_task_t *task, isc_event_t *event) {
|
|||
dns_resolver_t *res;
|
||||
unsigned int bucketnum;
|
||||
dns_validator_t *validator;
|
||||
isc_boolean_t destroy = ISC_FALSE;
|
||||
isc_boolean_t dodestroy = ISC_FALSE;
|
||||
|
||||
REQUIRE(VALID_FCTX(fctx));
|
||||
|
||||
|
|
@ -3747,12 +3747,12 @@ fctx_doshutdown(isc_task_t *task, isc_event_t *event) {
|
|||
if (fctx->references == 0 && fctx->pending == 0 &&
|
||||
fctx->nqueries == 0 && ISC_LIST_EMPTY(fctx->validators)) {
|
||||
bucket_empty = fctx_unlink(fctx);
|
||||
destroy = ISC_TRUE;
|
||||
dodestroy = ISC_TRUE;
|
||||
}
|
||||
|
||||
UNLOCK(&res->buckets[bucketnum].lock);
|
||||
|
||||
if (destroy) {
|
||||
if (dodestroy) {
|
||||
fctx_destroy(fctx);
|
||||
if (bucket_empty)
|
||||
empty_bucket(res);
|
||||
|
|
@ -3765,7 +3765,7 @@ fctx_start(isc_task_t *task, isc_event_t *event) {
|
|||
isc_boolean_t done = ISC_FALSE, bucket_empty = ISC_FALSE;
|
||||
dns_resolver_t *res;
|
||||
unsigned int bucketnum;
|
||||
isc_boolean_t destroy = ISC_FALSE;
|
||||
isc_boolean_t dodestroy = ISC_FALSE;
|
||||
|
||||
REQUIRE(VALID_FCTX(fctx));
|
||||
|
||||
|
|
@ -3799,7 +3799,7 @@ fctx_start(isc_task_t *task, isc_event_t *event) {
|
|||
* It's now safe to destroy this fctx.
|
||||
*/
|
||||
bucket_empty = fctx_unlink(fctx);
|
||||
destroy = ISC_TRUE;
|
||||
dodestroy = ISC_TRUE;
|
||||
}
|
||||
done = ISC_TRUE;
|
||||
} else {
|
||||
|
|
@ -3821,7 +3821,7 @@ fctx_start(isc_task_t *task, isc_event_t *event) {
|
|||
if (!done) {
|
||||
isc_result_t result;
|
||||
|
||||
INSIST(!destroy);
|
||||
INSIST(!dodestroy);
|
||||
|
||||
/*
|
||||
* All is well. Start working on the fetch.
|
||||
|
|
@ -3831,7 +3831,7 @@ fctx_start(isc_task_t *task, isc_event_t *event) {
|
|||
fctx_done(fctx, result, __LINE__);
|
||||
else
|
||||
fctx_try(fctx, ISC_FALSE, ISC_FALSE);
|
||||
} else if (destroy) {
|
||||
} else if (dodestroy) {
|
||||
fctx_destroy(fctx);
|
||||
if (bucket_empty)
|
||||
empty_bucket(res);
|
||||
|
|
@ -4407,7 +4407,7 @@ maybe_destroy(fetchctx_t *fctx, isc_boolean_t locked) {
|
|||
isc_boolean_t bucket_empty = ISC_FALSE;
|
||||
dns_resolver_t *res = fctx->res;
|
||||
dns_validator_t *validator, *next_validator;
|
||||
isc_boolean_t destroy = ISC_FALSE;
|
||||
isc_boolean_t dodestroy = ISC_FALSE;
|
||||
|
||||
REQUIRE(SHUTTINGDOWN(fctx));
|
||||
|
||||
|
|
@ -4425,12 +4425,12 @@ maybe_destroy(fetchctx_t *fctx, isc_boolean_t locked) {
|
|||
|
||||
if (fctx->references == 0 && ISC_LIST_EMPTY(fctx->validators)) {
|
||||
bucket_empty = fctx_unlink(fctx);
|
||||
destroy = ISC_TRUE;
|
||||
dodestroy = ISC_TRUE;
|
||||
}
|
||||
unlock:
|
||||
if (!locked)
|
||||
UNLOCK(&res->buckets[bucketnum].lock);
|
||||
if (destroy)
|
||||
if (dodestroy)
|
||||
fctx_destroy(fctx);
|
||||
return (bucket_empty);
|
||||
}
|
||||
|
|
@ -8895,7 +8895,7 @@ dns_resolver_createfetch3(dns_resolver_t *res, dns_name_t *name,
|
|||
unsigned int count = 0;
|
||||
unsigned int spillat;
|
||||
unsigned int spillatmin;
|
||||
isc_boolean_t destroy = ISC_FALSE;
|
||||
isc_boolean_t dodestroy = ISC_FALSE;
|
||||
|
||||
UNUSED(forwarders);
|
||||
|
||||
|
|
@ -9000,14 +9000,14 @@ dns_resolver_createfetch3(dns_resolver_t *res, dns_name_t *name,
|
|||
* since we know we're not exiting.
|
||||
*/
|
||||
(void)fctx_unlink(fctx);
|
||||
destroy = ISC_TRUE;
|
||||
dodestroy = ISC_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
unlock:
|
||||
UNLOCK(&res->buckets[bucketnum].lock);
|
||||
|
||||
if (destroy)
|
||||
if (dodestroy)
|
||||
fctx_destroy(fctx);
|
||||
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
|
|
|
|||
|
|
@ -1245,9 +1245,9 @@ ispersistent(dns_db_t *db) {
|
|||
}
|
||||
|
||||
static void
|
||||
overmem(dns_db_t *db, isc_boolean_t overmem) {
|
||||
overmem(dns_db_t *db, isc_boolean_t over) {
|
||||
UNUSED(db);
|
||||
UNUSED(overmem);
|
||||
UNUSED(over);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -1257,9 +1257,9 @@ ispersistent(dns_db_t *db) {
|
|||
}
|
||||
|
||||
static void
|
||||
overmem(dns_db_t *db, isc_boolean_t overmem) {
|
||||
overmem(dns_db_t *db, isc_boolean_t over) {
|
||||
UNUSED(db);
|
||||
UNUSED(overmem);
|
||||
UNUSED(over);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ gssapi_spnego_decapsulate(OM_uint32 *,
|
|||
/* mod_auth_kerb.c */
|
||||
|
||||
static int
|
||||
cmp_gss_type(gss_buffer_t token, gss_OID oid)
|
||||
cmp_gss_type(gss_buffer_t token, gss_OID gssoid)
|
||||
{
|
||||
unsigned char *p;
|
||||
size_t len;
|
||||
|
|
@ -392,10 +392,10 @@ cmp_gss_type(gss_buffer_t token, gss_OID oid)
|
|||
if (*p++ != 0x06)
|
||||
return (GSS_S_DEFECTIVE_TOKEN);
|
||||
|
||||
if (((OM_uint32) *p++) != oid->length)
|
||||
if (((OM_uint32) *p++) != gssoid->length)
|
||||
return (GSS_S_DEFECTIVE_TOKEN);
|
||||
|
||||
return (memcmp(p, oid->elements, oid->length));
|
||||
return (memcmp(p, gssoid->elements, gssoid->length));
|
||||
}
|
||||
|
||||
/* accept_sec_context.c */
|
||||
|
|
|
|||
|
|
@ -2065,7 +2065,7 @@ dns_view_setfailttl(dns_view_t *view, isc_uint32_t fail_ttl) {
|
|||
isc_result_t
|
||||
dns_view_saventa(dns_view_t *view) {
|
||||
isc_result_t result;
|
||||
isc_boolean_t remove = ISC_FALSE;
|
||||
isc_boolean_t removefile = ISC_FALSE;
|
||||
dns_ntatable_t *ntatable = NULL;
|
||||
FILE *fp = NULL;
|
||||
|
||||
|
|
@ -2079,7 +2079,7 @@ dns_view_saventa(dns_view_t *view) {
|
|||
|
||||
result = dns_view_getntatable(view, &ntatable);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
remove = ISC_TRUE;
|
||||
removefile = ISC_TRUE;
|
||||
result = ISC_R_SUCCESS;
|
||||
goto cleanup;
|
||||
} else
|
||||
|
|
@ -2087,7 +2087,7 @@ dns_view_saventa(dns_view_t *view) {
|
|||
|
||||
result = dns_ntatable_save(ntatable, fp);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
remove = ISC_TRUE;
|
||||
removefile = ISC_TRUE;
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -2099,7 +2099,7 @@ dns_view_saventa(dns_view_t *view) {
|
|||
isc_stdio_close(fp);
|
||||
|
||||
/* Don't leave half-baked NTA save files lying around. */
|
||||
if (result != ISC_R_SUCCESS || remove)
|
||||
if (result != ISC_R_SUCCESS || removefile)
|
||||
(void) isc_file_remove(view->nta_file);
|
||||
|
||||
return (result);
|
||||
|
|
|
|||
|
|
@ -17766,7 +17766,7 @@ keydone(isc_task_t *task, isc_event_t *event) {
|
|||
dns_dbnode_t *node = NULL;
|
||||
dns_rdataset_t rdataset;
|
||||
dns_diff_t diff;
|
||||
struct keydone *keydone = (struct keydone *)event;
|
||||
struct keydone *kd = (struct keydone *)event;
|
||||
dns_update_log_t log = { update_log_cb, NULL };
|
||||
isc_boolean_t clear_pending = ISC_FALSE;
|
||||
|
||||
|
|
@ -17818,7 +17818,7 @@ keydone(isc_task_t *task, isc_event_t *event) {
|
|||
|
||||
dns_rdataset_current(&rdataset, &rdata);
|
||||
|
||||
if (keydone->all) {
|
||||
if (kd->all) {
|
||||
if (rdata.length == 5 && rdata.data[0] != 0 &&
|
||||
rdata.data[3] == 0 && rdata.data[4] == 1)
|
||||
found = ISC_TRUE;
|
||||
|
|
@ -17828,7 +17828,7 @@ keydone(isc_task_t *task, isc_event_t *event) {
|
|||
clear_pending = ISC_TRUE;
|
||||
}
|
||||
} else if (rdata.length == 5 &&
|
||||
memcmp(rdata.data, keydone->data, 5) == 0)
|
||||
memcmp(rdata.data, kd->data, 5) == 0)
|
||||
found = ISC_TRUE;
|
||||
|
||||
if (found)
|
||||
|
|
|
|||
|
|
@ -221,17 +221,17 @@ isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
|
|||
#endif
|
||||
|
||||
isc_result_t
|
||||
isc_backtrace_getsymbolfromindex(int index, const void **addrp,
|
||||
isc_backtrace_getsymbolfromindex(int idx, const void **addrp,
|
||||
const char **symbolp)
|
||||
{
|
||||
REQUIRE(addrp != NULL && *addrp == NULL);
|
||||
REQUIRE(symbolp != NULL && *symbolp == NULL);
|
||||
|
||||
if (index < 0 || index >= isc__backtrace_nsymbols)
|
||||
if (idx < 0 || idx >= isc__backtrace_nsymbols)
|
||||
return (ISC_R_RANGE);
|
||||
|
||||
*addrp = isc__backtrace_symtable[index].addr;
|
||||
*symbolp = isc__backtrace_symtable[index].symbol;
|
||||
*addrp = isc__backtrace_symtable[idx].addr;
|
||||
*symbolp = isc__backtrace_symtable[idx].symbol;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ struct isc_heap {
|
|||
|
||||
isc_result_t
|
||||
isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
|
||||
isc_heapindex_t index, unsigned int size_increment,
|
||||
isc_heapindex_t idx, unsigned int size_increment,
|
||||
isc_heap_t **heapp)
|
||||
{
|
||||
isc_heap_t *heap;
|
||||
|
|
@ -96,7 +96,7 @@ isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
|
|||
heap->last = 0;
|
||||
heap->array = NULL;
|
||||
heap->compare = compare;
|
||||
heap->index = index;
|
||||
heap->index = idx;
|
||||
|
||||
*heapp = heap;
|
||||
|
||||
|
|
@ -203,14 +203,14 @@ isc_heap_insert(isc_heap_t *heap, void *elt) {
|
|||
}
|
||||
|
||||
void
|
||||
isc_heap_delete(isc_heap_t *heap, unsigned int index) {
|
||||
isc_heap_delete(isc_heap_t *heap, unsigned int idx) {
|
||||
void *elt;
|
||||
isc_boolean_t less;
|
||||
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
REQUIRE(index >= 1 && index <= heap->last);
|
||||
REQUIRE(idx >= 1 && idx <= heap->last);
|
||||
|
||||
if (index == heap->last) {
|
||||
if (idx == heap->last) {
|
||||
heap->array[heap->last] = NULL;
|
||||
heap->last--;
|
||||
} else {
|
||||
|
|
@ -218,38 +218,38 @@ isc_heap_delete(isc_heap_t *heap, unsigned int index) {
|
|||
heap->array[heap->last] = NULL;
|
||||
heap->last--;
|
||||
|
||||
less = heap->compare(elt, heap->array[index]);
|
||||
heap->array[index] = elt;
|
||||
less = heap->compare(elt, heap->array[idx]);
|
||||
heap->array[idx] = elt;
|
||||
if (less)
|
||||
float_up(heap, index, heap->array[index]);
|
||||
float_up(heap, idx, heap->array[idx]);
|
||||
else
|
||||
sink_down(heap, index, heap->array[index]);
|
||||
sink_down(heap, idx, heap->array[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
isc_heap_increased(isc_heap_t *heap, unsigned int index) {
|
||||
isc_heap_increased(isc_heap_t *heap, unsigned int idx) {
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
REQUIRE(index >= 1 && index <= heap->last);
|
||||
REQUIRE(idx >= 1 && idx <= heap->last);
|
||||
|
||||
float_up(heap, index, heap->array[index]);
|
||||
float_up(heap, idx, heap->array[idx]);
|
||||
}
|
||||
|
||||
void
|
||||
isc_heap_decreased(isc_heap_t *heap, unsigned int index) {
|
||||
isc_heap_decreased(isc_heap_t *heap, unsigned int idx) {
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
REQUIRE(index >= 1 && index <= heap->last);
|
||||
REQUIRE(idx >= 1 && idx <= heap->last);
|
||||
|
||||
sink_down(heap, index, heap->array[index]);
|
||||
sink_down(heap, idx, heap->array[idx]);
|
||||
}
|
||||
|
||||
void *
|
||||
isc_heap_element(isc_heap_t *heap, unsigned int index) {
|
||||
isc_heap_element(isc_heap_t *heap, unsigned int idx) {
|
||||
REQUIRE(VALID_HEAP(heap));
|
||||
REQUIRE(index >= 1);
|
||||
REQUIRE(idx >= 1);
|
||||
|
||||
if (index <= heap->last)
|
||||
return (heap->array[index]);
|
||||
if (idx <= heap->last)
|
||||
return (heap->array[idx]);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ alloc_pool(isc_mem_t *mctx, unsigned int count, isc_pool_t **poolp) {
|
|||
|
||||
isc_result_t
|
||||
isc_pool_create(isc_mem_t *mctx, unsigned int count,
|
||||
isc_pooldeallocator_t free,
|
||||
isc_pooldeallocator_t release,
|
||||
isc_poolinitializer_t init, void *initarg,
|
||||
isc_pool_t **poolp)
|
||||
{
|
||||
|
|
@ -85,7 +85,7 @@ isc_pool_create(isc_mem_t *mctx, unsigned int count,
|
|||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
pool->free = free;
|
||||
pool->free = release;
|
||||
pool->init = init;
|
||||
pool->initarg = initarg;
|
||||
|
||||
|
|
|
|||
|
|
@ -235,10 +235,10 @@ isc_socket_gettype(isc_socket_t *sock) {
|
|||
}
|
||||
|
||||
void
|
||||
isc_socket_setname(isc_socket_t *socket, const char *name, void *tag) {
|
||||
REQUIRE(ISCAPI_SOCKET_VALID(socket));
|
||||
isc_socket_setname(isc_socket_t *sock, const char *name, void *tag) {
|
||||
REQUIRE(ISCAPI_SOCKET_VALID(sock));
|
||||
|
||||
UNUSED(socket); /* in case REQUIRE() is empty */
|
||||
UNUSED(sock); /* in case REQUIRE() is empty */
|
||||
UNUSED(name);
|
||||
UNUSED(tag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,12 +141,12 @@ isc_file_mode(const char *file, mode_t *modep) {
|
|||
}
|
||||
|
||||
isc_result_t
|
||||
isc_file_getmodtime(const char *file, isc_time_t *time) {
|
||||
isc_file_getmodtime(const char *file, isc_time_t *modtime) {
|
||||
isc_result_t result;
|
||||
struct stat stats;
|
||||
|
||||
REQUIRE(file != NULL);
|
||||
REQUIRE(time != NULL);
|
||||
REQUIRE(modtime != NULL);
|
||||
|
||||
result = file_stats(file, &stats);
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ isc_file_getmodtime(const char *file, isc_time_t *time) {
|
|||
* XXXDCL some operating systems provide nanoseconds, too,
|
||||
* such as BSD/OS via st_mtimespec.
|
||||
*/
|
||||
isc_time_set(time, stats.st_mtime, 0);
|
||||
isc_time_set(modtime, stats.st_mtime, 0);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -177,10 +177,10 @@ isc_file_getsize(const char *file, off_t *size) {
|
|||
}
|
||||
|
||||
isc_result_t
|
||||
isc_file_settime(const char *file, isc_time_t *time) {
|
||||
isc_file_settime(const char *file, isc_time_t *when) {
|
||||
struct timeval times[2];
|
||||
|
||||
REQUIRE(file != NULL && time != NULL);
|
||||
REQUIRE(file != NULL && when != NULL);
|
||||
|
||||
/*
|
||||
* tv_sec is at least a 32 bit quantity on all platforms we're
|
||||
|
|
@ -192,7 +192,7 @@ isc_file_settime(const char *file, isc_time_t *time) {
|
|||
* * isc_time_seconds is changed to be > 32 bits but long is 32 bits
|
||||
* and isc_time_seconds has at least 33 significant bits.
|
||||
*/
|
||||
times[0].tv_sec = times[1].tv_sec = (long)isc_time_seconds(time);
|
||||
times[0].tv_sec = times[1].tv_sec = (long)isc_time_seconds(when);
|
||||
|
||||
/*
|
||||
* Here is the real check for the high bit being set.
|
||||
|
|
@ -208,7 +208,7 @@ isc_file_settime(const char *file, isc_time_t *time) {
|
|||
* we can at least cast to signed so the IRIX compiler shuts up.
|
||||
*/
|
||||
times[0].tv_usec = times[1].tv_usec =
|
||||
(isc_int32_t)(isc_time_nanoseconds(time) / 1000);
|
||||
(isc_int32_t)(isc_time_nanoseconds(when) / 1000);
|
||||
|
||||
if (utimes(file, times) < 0)
|
||||
return (isc__errno2result(errno));
|
||||
|
|
|
|||
|
|
@ -6401,33 +6401,33 @@ isc__socketmgr_dispatch(isc_socketmgr_t *manager0, isc_socketwait_t *swait) {
|
|||
|
||||
void
|
||||
isc__socket_setname(isc_socket_t *socket0, const char *name, void *tag) {
|
||||
isc__socket_t *socket = (isc__socket_t *)socket0;
|
||||
isc__socket_t *sock = (isc__socket_t *)socket0;
|
||||
|
||||
/*
|
||||
* Name 'socket'.
|
||||
* Name 'sock'.
|
||||
*/
|
||||
|
||||
REQUIRE(VALID_SOCKET(socket));
|
||||
REQUIRE(VALID_SOCKET(sock));
|
||||
|
||||
LOCK(&socket->lock);
|
||||
memset(socket->name, 0, sizeof(socket->name));
|
||||
strncpy(socket->name, name, sizeof(socket->name) - 1);
|
||||
socket->tag = tag;
|
||||
UNLOCK(&socket->lock);
|
||||
LOCK(&sock->lock);
|
||||
memset(sock->name, 0, sizeof(sock->name));
|
||||
strncpy(sock->name, name, sizeof(sock->name) - 1);
|
||||
sock->tag = tag;
|
||||
UNLOCK(&sock->lock);
|
||||
}
|
||||
|
||||
const char *
|
||||
isc__socket_getname(isc_socket_t *socket0) {
|
||||
isc__socket_t *socket = (isc__socket_t *)socket0;
|
||||
isc__socket_t *sock = (isc__socket_t *)socket0;
|
||||
|
||||
return (socket->name);
|
||||
return (sock->name);
|
||||
}
|
||||
|
||||
void *
|
||||
isc__socket_gettag(isc_socket_t *socket0) {
|
||||
isc__socket_t *socket = (isc__socket_t *)socket0;
|
||||
isc__socket_t *sock = (isc__socket_t *)socket0;
|
||||
|
||||
return (socket->tag);
|
||||
return (sock->tag);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -6437,9 +6437,9 @@ isc__socket_register(void) {
|
|||
|
||||
int
|
||||
isc__socket_getfd(isc_socket_t *socket0) {
|
||||
isc__socket_t *socket = (isc__socket_t *)socket0;
|
||||
isc__socket_t *sock = (isc__socket_t *)socket0;
|
||||
|
||||
return ((short) socket->fd);
|
||||
return ((short) sock->fd);
|
||||
}
|
||||
|
||||
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON)
|
||||
|
|
|
|||
Loading…
Reference in a new issue