diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 7dc536c928..2fb7283721 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -2534,7 +2534,8 @@ setup_lookup(dig_lookup_t *lookup) { isc_buffer_putuint8(&b, 0); /* address */ if (addrl > 0) { - isc_buffer_putmem(&b, addr, addrl - 1); + isc_buffer_putmem(&b, addr, + (unsigned)addrl - 1); isc_buffer_putuint8(&b, (addr[addrl - 1] & mask)); @@ -2550,7 +2551,8 @@ setup_lookup(dig_lookup_t *lookup) { isc_buffer_putuint8(&b, 0); /* address */ if (addrl > 0) { - isc_buffer_putmem(&b, addr, addrl - 1); + isc_buffer_putmem(&b, addr, + (unsigned)addrl - 1); isc_buffer_putuint8(&b, (addr[addrl - 1] & mask)); diff --git a/bin/named/client.c b/bin/named/client.c index 0fa461f62f..26b57b9b02 100644 --- a/bin/named/client.c +++ b/bin/named/client.c @@ -1178,7 +1178,7 @@ client_send(ns_client_t *client) { #endif /* HAVE_DNSTAP */ isc_stats_increment(ns_g_server->tcpoutstats, - ISC_MIN(respsize / 16, 256)); + ISC_MIN((int)respsize / 16, 256)); } else { respsize = isc_buffer_usedlength(&buffer); result = client_sendpkg(client, &buffer); @@ -1192,7 +1192,7 @@ client_send(ns_client_t *client) { #endif /* HAVE_DNSTAP */ isc_stats_increment(ns_g_server->udpoutstats, - ISC_MIN(respsize / 16, 256)); + ISC_MIN((int)respsize / 16, 256)); } /* update statistics (XXXJT: is it okay to access message->xxxkey?) */ @@ -1736,7 +1736,7 @@ compute_cookie(ns_client_t *client, isc_uint32_t when, isc_uint32_t nonce, isc_netaddr_t netaddr; unsigned char *cp; isc_hmacsha1_t hmacsha1; - size_t length; + unsigned int length; cp = isc_buffer_used(buf); isc_buffer_putmem(buf, client->cookie, 8); @@ -1774,7 +1774,7 @@ compute_cookie(ns_client_t *client, isc_uint32_t when, isc_uint32_t nonce, isc_netaddr_t netaddr; unsigned char *cp; isc_hmacsha256_t hmacsha256; - size_t length; + unsigned int length; cp = isc_buffer_used(buf); isc_buffer_putmem(buf, client->cookie, 8); @@ -2261,10 +2261,10 @@ client_request(isc_task_t *task, isc_event_t *event) { isc_stats_increment(ns_g_server->nsstats, dns_nsstatscounter_requesttcp); isc_stats_increment(ns_g_server->tcpinstats, - ISC_MIN(reqsize / 16, 18)); + ISC_MIN((int)reqsize / 16, 18)); } else { isc_stats_increment(ns_g_server->udpinstats, - ISC_MIN(reqsize / 16, 18)); + ISC_MIN((int)reqsize / 16, 18)); } /* diff --git a/bin/named/server.c b/bin/named/server.c index ee55db2693..06559ec1e9 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -2860,7 +2860,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, if (max_cache_size == SIZE_AS_PERCENT) { isc_uint64_t totalphys = isc_meminfo_totalphys(); - max_cache_size = totalphys * max_cache_size_percent/100; + + max_cache_size = + (size_t) (totalphys * max_cache_size_percent/100); if (totalphys == 0) { cfg_obj_log(obj, ns_g_lctx, ISC_LOG_WARNING, @@ -2871,10 +2873,10 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_log(obj, ns_g_lctx, ISC_LOG_INFO, "'max-cache-size %d%%' " - "- setting to %zuMB (out of %luMB)", + "- setting to %zuMB (out of %zuMB)", max_cache_size_percent, max_cache_size / (1024*1024), - (unsigned long) totalphys / (1024*1024)); + (size_t) (totalphys / (1024*1024))); } } diff --git a/bin/tools/mdig.c b/bin/tools/mdig.c index c1fe59ec21..71102453a9 100644 --- a/bin/tools/mdig.c +++ b/bin/tools/mdig.c @@ -619,7 +619,8 @@ sendquery(struct query *query, isc_task_t *task) isc_buffer_putuint8(&b, 0); /* address */ if (addrl > 0) { - isc_buffer_putmem(&b, addr, addrl - 1); + isc_buffer_putmem(&b, addr, + (unsigned)addrl - 1); isc_buffer_putuint8(&b, (addr[addrl - 1] & mask)); @@ -635,7 +636,8 @@ sendquery(struct query *query, isc_task_t *task) isc_buffer_putuint8(&b, 0); /* address */ if (addrl > 0) { - isc_buffer_putmem(&b, addr, addrl - 1); + isc_buffer_putmem(&b, addr, + (unsigned)addrl - 1); isc_buffer_putuint8(&b, (addr[addrl - 1] & mask)); diff --git a/lib/dns/dyndb.c b/lib/dns/dyndb.c index 8e40cd0c4d..03b35a6712 100644 --- a/lib/dns/dyndb.c +++ b/lib/dns/dyndb.c @@ -225,7 +225,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname, isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, ISC_LOG_ERROR, - "dynamic database support is not implemented") + "dynamic database support is not implemented"); return (ISC_R_NOTIMPLEMENTED); } @@ -233,18 +233,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname, static void unload_library(dyndb_implementation_t **impp) { - dyndb_implementation_t *imp; - - REQUIRE(impp != NULL && *impp != NULL); - - imp = *impp; - - if (imp->handle != NULL) - dlclose(imp->handle); - - isc_mem_putanddetach(&imp->mctx, imp, sizeof(dyndb_implementation_t)); - - *impp = NULL; + UNUSED(impp); } #endif /* HAVE_DLFCN_H */ diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index 7b8019793a..bd6a92ecf9 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -331,7 +331,7 @@ totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) { isc_buffer_add(&buf, 1); if ((ctx->style.flags & DNS_STYLEFLAG_INDENT) != 0) { - size_t ilen = strlen(dns_master_indentstr); + unsigned int ilen = strlen(dns_master_indentstr); isc_buffer_availableregion(&buf, &r); if (r.length < ilen) return (DNS_R_TEXTTOOLONG); diff --git a/lib/dns/win32/libdns.dsp.in b/lib/dns/win32/libdns.dsp.in index cccae1fcef..11197c1c61 100644 --- a/lib/dns/win32/libdns.dsp.in +++ b/lib/dns/win32/libdns.dsp.in @@ -186,6 +186,10 @@ SOURCE=..\include\dns\ds.h # End Source File # Begin Source File +SOURCE=..\include\dns\dyndb.h +# End Source File +# Begin Source File + SOURCE=..\include\dns\ecdb.h # End Source File # Begin Source File @@ -556,6 +560,10 @@ SOURCE=..\ds.c # End Source File # Begin Source File +SOURCE=..\dyndb.c +# End Source File +# Begin Source File + SOURCE=..\ecdb.c # End Source File # Begin Source File diff --git a/lib/dns/win32/libdns.mak.in b/lib/dns/win32/libdns.mak.in index ca8c74527e..97fd8b34f6 100644 --- a/lib/dns/win32/libdns.mak.in +++ b/lib/dns/win32/libdns.mak.in @@ -144,6 +144,7 @@ CLEAN : -@erase "$(INTDIR)\dst_lib.obj" -@erase "$(INTDIR)\dst_parse.obj" -@erase "$(INTDIR)\dst_result.obj" + -@erase "$(INTDIR)\dyndb.obj" -@erase "$(INTDIR)\ecdb.obj" -@erase "$(INTDIR)\forward.obj" @IF GEOIP @@ -299,6 +300,7 @@ LINK32_OBJS= \ "$(INTDIR)\dns64.obj" \ "$(INTDIR)\dnssec.obj" \ "$(INTDIR)\ds.obj" \ + "$(INTDIR)\dyndb.obj" \ "$(INTDIR)\ecdb.obj" \ "$(INTDIR)\forward.obj" \ @IF GEOIP @@ -464,6 +466,8 @@ CLEAN : -@erase "$(INTDIR)\dst_parse.sbr" -@erase "$(INTDIR)\dst_result.obj" -@erase "$(INTDIR)\dst_result.sbr" + -@erase "$(INTDIR)\dyndb.obj" + -@erase "$(INTDIR)\dyndb.sbr" -@erase "$(INTDIR)\ecdb.obj" -@erase "$(INTDIR)\ecdb.sbr" -@erase "$(INTDIR)\forward.obj" @@ -695,6 +699,7 @@ BSC32_SBRS= \ "$(INTDIR)\dns64.sbr" \ "$(INTDIR)\dnssec.sbr" \ "$(INTDIR)\ds.sbr" \ + "$(INTDIR)\dyndb.sbr" \ "$(INTDIR)\ecdb.sbr" \ "$(INTDIR)\forward.sbr" \ @IF GEOIP @@ -812,6 +817,7 @@ LINK32_OBJS= \ "$(INTDIR)\dns64.obj" \ "$(INTDIR)\dnssec.obj" \ "$(INTDIR)\ds.obj" \ + "$(INTDIR)\dyndb.obj" \ "$(INTDIR)\ecdb.obj" \ "$(INTDIR)\forward.obj" \ @IF GEOIP @@ -1279,6 +1285,24 @@ SOURCE=..\ds.c $(CPP) $(CPP_PROJ) $(SOURCE) +!ENDIF + +SOURCE=..\dyndb.c + +!IF "$(CFG)" == "libdns - @PLATFORM@ Release" + + +"$(INTDIR)\dyndb.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "libdns - @PLATFORM@ Debug" + + +"$(INTDIR)\dyndb.obj" "$(INTDIR)\dyndb.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + !ENDIF SOURCE=..\ecdb.c diff --git a/lib/dns/win32/libdns.vcxproj.filters.in b/lib/dns/win32/libdns.vcxproj.filters.in index 1cdf90e2bd..5cd1987a34 100644 --- a/lib/dns/win32/libdns.vcxproj.filters.in +++ b/lib/dns/win32/libdns.vcxproj.filters.in @@ -87,6 +87,9 @@ Library Source Files + + Library Source Files + Library Source Files @@ -407,6 +410,9 @@ Library Header Files + + Library Header Files + Library Header Files diff --git a/lib/dns/win32/libdns.vcxproj.in b/lib/dns/win32/libdns.vcxproj.in index 48257e2906..f532bea6dc 100644 --- a/lib/dns/win32/libdns.vcxproj.in +++ b/lib/dns/win32/libdns.vcxproj.in @@ -130,6 +130,7 @@ + @IF GEOIP @@ -247,6 +248,7 @@ + diff --git a/lib/isc/include/isc/hash.h b/lib/isc/include/isc/hash.h index b68e108151..a53677ece5 100644 --- a/lib/isc/include/isc/hash.h +++ b/lib/isc/include/isc/hash.h @@ -81,7 +81,7 @@ ***/ ISC_LANG_BEGINDECLS -LIBDNS_EXTERNAL_DATA extern isc_hash_t *isc_hashctx; +LIBISC_EXTERNAL_DATA extern isc_hash_t *isc_hashctx; isc_result_t isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit, diff --git a/lib/isc/win32/libisc.def.in b/lib/isc/win32/libisc.def.in index 010a7ef4d6..d982c5db27 100644 --- a/lib/isc/win32/libisc.def.in +++ b/lib/isc/win32/libisc.def.in @@ -262,7 +262,6 @@ isc_hash_ctxdetach isc_hash_ctxinit isc_hash_destroy isc_hash_init -isc_hashctx isc_heap_create isc_heap_decreased isc_heap_delete @@ -779,5 +778,6 @@ isc_commandline_index DATA isc_commandline_option DATA isc_commandline_progname DATA isc_commandline_reset DATA +isc_hashctx DATA isc_mem_debugging DATA @END NOLONGER diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index fe3bac3b5f..fe1ad63a92 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -409,7 +409,7 @@ sock_dump(isc_socket_t *sock) { #endif printf("\n\t\tSock Dump\n"); - printf("\t\tfd: %u\n", sock->fd); + printf("\t\tfd: %Iu\n", sock->fd); printf("\t\treferences: %d\n", sock->references); printf("\t\tpending_accept: %d\n", sock->pending_accept); printf("\t\tconnecting: %d\n", sock->pending_connect); @@ -1114,7 +1114,7 @@ static void dump_msg(struct msghdr *msg, isc_socket_t *sock) { unsigned int i; - printf("MSGHDR %p, Socket #: %u\n", msg, sock->fd); + printf("MSGHDR %p, Socket #: %Iu\n", msg, sock->fd); printf("\tname %p, namelen %d\n", msg->msg_name, msg->msg_namelen); printf("\tiov %p, iovlen %d\n", msg->msg_iov, msg->msg_iovlen); for (i = 0; i < (unsigned int)msg->msg_iovlen; i++) diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index 69d619257f..d236ed0cae 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -2170,7 +2170,7 @@ parse_sizeval_percent(cfg_parser_t *pctx, const cfg_type_t *type, isc_result_t result; cfg_obj_t *obj = NULL; isc_uint64_t val; - isc_uint32_t percent; + isc_uint64_t percent; UNUSED(type); @@ -2184,7 +2184,7 @@ parse_sizeval_percent(cfg_parser_t *pctx, const cfg_type_t *type, if (*endp == '%' && *(endp+1) == 0) { CHECK(cfg_create_obj(pctx, &cfg_type_percentage, &obj)); - obj->value.uint32 = percent; + obj->value.uint32 = (isc_uint32_t)percent; *ret = obj; return (ISC_R_SUCCESS); } else { diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index f486acbf59..b9621ef43a 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -661,7 +661,7 @@ cfg_parse_percentage(cfg_parser_t *pctx, const cfg_type_t *type, char *endp; isc_result_t result; cfg_obj_t *obj = NULL; - isc_uint32_t percent; + isc_uint64_t percent; UNUSED(type); @@ -680,7 +680,7 @@ cfg_parse_percentage(cfg_parser_t *pctx, const cfg_type_t *type, } CHECK(cfg_create_obj(pctx, &cfg_type_percentage, &obj)); - obj->value.uint32 = percent; + obj->value.uint32 = (isc_uint32_t)percent; *ret = obj; cleanup: