From a03340dc52b29a9af5c2acdc36f5985502f080e3 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 31 Jul 2014 08:21:09 +0000 Subject: [PATCH] please lint for dns64. git-svn-id: file:///svn/unbound/trunk@3201 be551aaa-1e26-0410-a405-d3ace91eadb9 --- dns64/dns64.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dns64/dns64.c b/dns64/dns64.c index 2e5b41945..7809c340b 100644 --- a/dns64/dns64.c +++ b/dns64/dns64.c @@ -64,7 +64,7 @@ static const char DEFAULT_DNS64_PREFIX[] = "64:ff9b::/96"; /** * Maximum length of a domain name in a PTR query in the .in-addr.arpa tree. */ -static const int MAX_PTR_QNAME_IPV4 = 30; +#define MAX_PTR_QNAME_IPV4 30 /** * Per-query module-specific state. This is usually a dynamically-allocated @@ -199,7 +199,7 @@ extract_ipv4(const uint8_t ipv6[16], const int offset) * * \return The number of characters written. */ -static int +static size_t ipv4_to_ptr(uint32_t ipv4, char ptr[MAX_PTR_QNAME_IPV4]) { static const char IPV4_PTR_SUFFIX[] = "\07in-addr\04arpa"; @@ -207,7 +207,7 @@ ipv4_to_ptr(uint32_t ipv4, char ptr[MAX_PTR_QNAME_IPV4]) char* c = ptr; for (i = 0; i < 4; ++i) { - *c = uitoa(ipv4 % 256, c + 1); + *c = uitoa((unsigned int)(ipv4 % 256), c + 1); c += *c + 1; ipv4 /= 256; } @@ -381,7 +381,7 @@ handle_ipv6_ptr(struct module_qstate* qstate, int id) */ if (addr_in_common((struct sockaddr_storage*)&sin6, 128, &dns64_env->prefix_addr, dns64_env->prefix_net, - sizeof(sin6)) != dns64_env->prefix_net) + (socklen_t)sizeof(sin6)) != dns64_env->prefix_net) return module_wait_module; verbose(VERB_ALGO, "dns64: rewrite PTR record"); @@ -523,7 +523,7 @@ handle_event_moddone(struct module_qstate* qstate, int id) * - An AAAA query for which an error was returned. * - A successful AAAA query with an answer. */ - if (qstate->minfo[id] == DNS64_INTERNAL_QUERY + if ( (enum dns64_qstate)qstate->minfo[id] == DNS64_INTERNAL_QUERY || qstate->qinfo.qtype != LDNS_RR_TYPE_AAAA || qstate->return_rcode != LDNS_RCODE_NOERROR || (qstate->return_msg && -- 2.47.2