diff options
author | des <des@FreeBSD.org> | 2013-09-15 00:36:18 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2013-09-15 00:36:18 +0000 |
commit | a4b7c5a2b891b1626cbc7f0dd45a198e1f5f037f (patch) | |
tree | db350d281e6140731c10d0c9e2991b25cb238d39 /contrib/unbound/daemon/worker.c | |
parent | aafb05a3bcadf34af0465fcf05f3fc918053ed4f (diff) | |
download | FreeBSD-src-a4b7c5a2b891b1626cbc7f0dd45a198e1f5f037f.zip FreeBSD-src-a4b7c5a2b891b1626cbc7f0dd45a198e1f5f037f.tar.gz |
Numerous fixes to make Unbound compile cleanly:
- cast through void * to silence alignment warnings (presumably false
positives resulting from poor API design)
- constify a few function arguments
- move prototypes for callbacks into a common header
- now that the prototypes are in scope, fix instances of function
definitions that don't match the prototype or what the caller
actually passes
- hide a conditionally unused global variable behind the same #ifdef
that controls its use
Approved by: re (blanket)
Diffstat (limited to 'contrib/unbound/daemon/worker.c')
-rw-r--r-- | contrib/unbound/daemon/worker.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/unbound/daemon/worker.c b/contrib/unbound/daemon/worker.c index eeb323c..0e5b14d 100644 --- a/contrib/unbound/daemon/worker.c +++ b/contrib/unbound/daemon/worker.c @@ -70,6 +70,8 @@ #include "iterator/iter_hints.h" #include "validator/autotrust.h" #include "validator/val_anchor.h" +#include "libunbound/context.h" +#include "libunbound/libworker.h" #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> @@ -819,7 +821,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error, verbose(VERB_ALGO, "query with bad edns version."); log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen); error_encode(c->buffer, EDNS_RCODE_BADVERS&0xf, &qinfo, - *(uint16_t*)ldns_buffer_begin(c->buffer), + *(uint16_t*)(void *)ldns_buffer_begin(c->buffer), ldns_buffer_read_u16_at(c->buffer, 2), NULL); attach_edns_record(c->buffer, &edns); return 1; @@ -883,7 +885,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error, /* answer from cache - we have acquired a readlock on it */ if(answer_from_cache(worker, &qinfo, (struct reply_info*)e->data, - *(uint16_t*)ldns_buffer_begin(c->buffer), + *(uint16_t*)(void *)ldns_buffer_begin(c->buffer), ldns_buffer_read_u16_at(c->buffer, 2), repinfo, &edns)) { /* prefetch it if the prefetch TTL expired */ @@ -905,7 +907,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error, } if(!LDNS_RD_WIRE(ldns_buffer_begin(c->buffer))) { if(answer_norec_from_cache(worker, &qinfo, - *(uint16_t*)ldns_buffer_begin(c->buffer), + *(uint16_t*)(void *)ldns_buffer_begin(c->buffer), ldns_buffer_read_u16_at(c->buffer, 2), repinfo, &edns)) { return 1; @@ -926,8 +928,8 @@ worker_handle_request(struct comm_point* c, void* arg, int error, /* grab a work request structure for this new request */ mesh_new_client(worker->env.mesh, &qinfo, - ldns_buffer_read_u16_at(c->buffer, 2), - &edns, repinfo, *(uint16_t*)ldns_buffer_begin(c->buffer)); + ldns_buffer_read_u16_at(c->buffer, 2), &edns, repinfo, + *(uint16_t*)(void *)ldns_buffer_begin(c->buffer)); worker_mem_report(worker, NULL); return 0; } @@ -1303,7 +1305,8 @@ struct outbound_entry* libworker_send_query(uint8_t* ATTR_UNUSED(qname), uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags), int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec), struct sockaddr_storage* ATTR_UNUSED(addr), - socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q)) + socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone), + size_t ATTR_UNUSED(zonelen), struct module_qstate* ATTR_UNUSED(q)) { log_assert(0); return 0; |