Merge branch 'develop' into features/DNS64

This commit is contained in:
Willem Toorop 2017-09-04 16:43:21 +02:00
commit 42248c8893
17 changed files with 106 additions and 37 deletions

View File

@ -14,7 +14,9 @@ addons:
- valgrind
- clang
- wget
- openssh-client
script:
- mkdir tests
- cd tests
- ../src/test/tpkg/run-all.sh
# - ../src/test/tpkg/run-one.sh 400-static-analysis -V

View File

@ -1,4 +1,5 @@
* 2017-0?-??: Version 1.1.3
* 2017-09-04: Version 1.1.3
* Small bugfixes that came out of static analysis
* No annotations with the output of getdns_query anymore,
unless -V option is given to increase verbosity
Thanks Ollivier Robert

View File

@ -41,7 +41,7 @@ AC_INIT([getdns], [1.1.3], [users@getdnsapi.net], [], [https://getdnsapi.net])
# Dont forget to put a dash in front of the release candidate!!!
# That is how it is done with semantic versioning!
#
AC_SUBST(RELEASE_CANDIDATE, [-rc1])
AC_SUBST(RELEASE_CANDIDATE, [])
# Set current date from system if not set
AC_ARG_WITH([current-date],
@ -51,7 +51,7 @@ AC_ARG_WITH([current-date],
[CURRENT_DATE="`date -u +%Y-%m-%dT%H:%M:%SZ`"])
AC_SUBST(GETDNS_VERSION, ["AC_PACKAGE_VERSION$RELEASE_CANDIDATE"])
AC_SUBST(GETDNS_NUMERIC_VERSION, [0x010102c1])
AC_SUBST(GETDNS_NUMERIC_VERSION, [0x01010300])
AC_SUBST(API_VERSION, ["December 2015"])
AC_SUBST(API_NUMERIC_VERSION, [0x07df0c00])
GETDNS_COMPILATION_COMMENT="AC_PACKAGE_NAME $GETDNS_VERSION configured on $CURRENT_DATE for the $API_VERSION version of the API"

View File

@ -272,6 +272,7 @@ static struct const_name_info consts_name_info[] = {
{ "GETDNS_RRTYPE_DLV", 32769 },
{ "GETDNS_RRTYPE_DNAME", 39 },
{ "GETDNS_RRTYPE_DNSKEY", 48 },
{ "GETDNS_RRTYPE_DOA", 259 },
{ "GETDNS_RRTYPE_DS", 43 },
{ "GETDNS_RRTYPE_EID", 31 },
{ "GETDNS_RRTYPE_GID", 102 },

View File

@ -1116,7 +1116,8 @@ set_os_defaults_windows(struct getdns_context *context)
ptr = &info->DnsServerList;
*domain = 0;
while (ptr) {
for (size_t i = 0; i < GETDNS_UPSTREAM_TRANSPORTS; i++) {
size_t i;
for (i = 0; i < GETDNS_UPSTREAM_TRANSPORTS; i++) {
char *port_str = getdns_port_str_array[i];
if ((s = getaddrinfo(ptr->IpAddress.String, port_str, &hints, &result)))
continue;
@ -1209,6 +1210,8 @@ set_os_defaults(struct getdns_context *context)
*domain = 0;
while (fgets(line, (int)sizeof(line), in)) {
size_t i;
line[sizeof(line)-1] = 0;
/* parse = line + strspn(line, " \t"); */ /* No leading whitespace */
parse = line;
@ -1248,7 +1251,7 @@ set_os_defaults(struct getdns_context *context)
token = parse + strcspn(parse, " \t\r\n");
*token = 0;
for (size_t i = 0; i < GETDNS_UPSTREAM_TRANSPORTS; i++) {
for (i = 0; i < GETDNS_UPSTREAM_TRANSPORTS; i++) {
char *port_str = getdns_port_str_array[i];
if ((s = getaddrinfo(parse, port_str, &hints, &result)))
continue;
@ -2006,6 +2009,9 @@ getdns_set_base_dns_transports(
static getdns_return_t
set_ub_dns_transport(struct getdns_context* context) {
int fallback;
size_t i;
/* These mappings are not exact because Unbound is configured differently,
so just map as close as possible. Not all options can be supported.*/
switch (context->dns_transports[0]) {
@ -2025,8 +2031,8 @@ set_ub_dns_transport(struct getdns_context* context) {
set_ub_string_opt(context, "do-udp:", "no");
set_ub_string_opt(context, "do-tcp:", "yes");
/* Find out if there is a fallback available. */
int fallback = 0;
for (size_t i = 1; i < context->dns_transport_count; i++) {
fallback = 0;
for (i = 1; i < context->dns_transport_count; i++) {
if (context->dns_transports[i] == GETDNS_TRANSPORT_TCP) {
fallback = 1;
break;
@ -2698,6 +2704,8 @@ getdns_context_set_upstream_recursive_servers(struct getdns_context *context,
uint8_t tsig_dname_spc[256], *tsig_dname;
size_t tsig_dname_len;
size_t j;
if ((r = getdns_list_get_dict(upstream_list, i, &dict))) {
dict = NULL;
@ -2819,7 +2827,7 @@ getdns_context_set_upstream_recursive_servers(struct getdns_context *context,
*/
/* Loop to create upstreams as needed*/
for (size_t j = 0; j < GETDNS_UPSTREAM_TRANSPORTS; j++) {
for (j = 0; j < GETDNS_UPSTREAM_TRANSPORTS; j++) {
uint32_t port;
struct addrinfo *ai;
port = getdns_port_array[j];

View File

@ -437,6 +437,7 @@ typedef enum getdns_callback_type_t {
#define GETDNS_RRTYPE_URI 256
#define GETDNS_RRTYPE_CAA 257
#define GETDNS_RRTYPE_AVC 258
#define GETDNS_RRTYPE_DOA 259
#define GETDNS_RRTYPE_TA 32768
#define GETDNS_RRTYPE_DLV 32769
/** @}

View File

@ -227,6 +227,7 @@ enum gldns_enum_rr_type
GLDNS_RR_TYPE_URI = 256, /* RFC 7553 */
GLDNS_RR_TYPE_CAA = 257, /* RFC 6844 */
GLDNS_RR_TYPE_AVC = 258,
GLDNS_RR_TYPE_DOA = 259,
/** DNSSEC Trust Authorities */
GLDNS_RR_TYPE_TA = 32768,

View File

@ -328,8 +328,8 @@ _getdns_list_copy(const struct getdns_list * srclist,
srclist->mf.mf.ext.realloc,
srclist->mf.mf.ext.free
);
if (!dstlist)
return GETDNS_RETURN_GENERIC_ERROR;
if (!*dstlist)
return GETDNS_RETURN_MEMORY_ERROR;
for (i = 0; i < srclist->numinuse; i++) {
switch (srclist->items[i].dtype) {

View File

@ -238,7 +238,8 @@ mdns_util_canonical_flags_and_name(uint8_t *message, int message_length,
}
else
{
for (int i = 0; i < nb_octets_to_copy; i++)
int i;
for (i = 0; i < nb_octets_to_copy; i++)
{
buffer[buffer_index++] = message[current_index++];
}
@ -702,6 +703,7 @@ mdns_update_cache_ttl_and_prune(struct getdns_context *context,
int current_hole_index = 0;
int record_name_length = 0;
int record_ttl_index = 0;
int i;
/*
* Skip the query
@ -716,7 +718,7 @@ mdns_update_cache_ttl_and_prune(struct getdns_context *context,
/*
* Examine each record
*/
for (int i = 0; i < nb_answers; i++)
for (i = 0; i < nb_answers; i++)
{
record_name_length = mdns_util_skip_name(old_record + answer_index);
record_ttl_index = answer_index + record_name_length + 2 + 2;
@ -1489,8 +1491,9 @@ static getdns_return_t mdns_delayed_network_init(struct getdns_context *context)
}
else
{
int i;
/* TODO: launch the receive loops */
for (int i = 0; i < 2; i++)
for (i = 0; i < 2; i++)
{
GETDNS_CLEAR_EVENT(context->extension, &context->mdns_connection[i].event);
GETDNS_SCHEDULE_EVENT(
@ -1503,7 +1506,8 @@ static getdns_return_t mdns_delayed_network_init(struct getdns_context *context)
if (ret != 0)
{
for (int i = 0; i < 2; i++)
int i;
for (i = 0; i < 2; i++)
{
if (context->mdns_connection[i].fd != -1)
{
@ -1647,7 +1651,8 @@ void _getdns_mdns_context_destroy(struct getdns_context *context)
/* Close the connections */
if (context->mdns_connection != NULL)
{
for (int i = 0; i < context->mdns_connection_nb; i++)
int i;
for (i = 0; i < context->mdns_connection_nb; i++)
{
/* suppress the receive event */
GETDNS_CLEAR_EVENT(context->extension, &context->mdns_connection[i].event);

View File

@ -920,7 +920,8 @@ static _getdns_rr_def _getdns_rr_defs[] = {
{ NULL, NULL, 0 },
{ "URI", uri_rdata, ALEN( uri_rdata) }, /* 256 - */
{ "CAA", caa_rdata, ALEN( caa_rdata) },
{ "AVC", txt_rdata, ALEN( txt_rdata) }, /* - 258 */
{ "AVC", txt_rdata, ALEN( txt_rdata) },
{ "DOA", UNKNOWN_RDATA, 0 }, /* - 259 */
{ "TA", ds_rdata, ALEN( ds_rdata) }, /* 32768 */
{ "DLV", dlv_rdata, ALEN( dlv_rdata) } /* 32769 */
};
@ -928,12 +929,12 @@ static _getdns_rr_def _getdns_rr_defs[] = {
const _getdns_rr_def *
_getdns_rr_def_lookup(uint16_t rr_type)
{
if (rr_type <= 258)
if (rr_type <= 259)
return &_getdns_rr_defs[rr_type];
else if (rr_type == 32768)
return &_getdns_rr_defs[259];
else if (rr_type == 32769)
return &_getdns_rr_defs[260];
else if (rr_type == 32769)
return &_getdns_rr_defs[261];
return _getdns_rr_defs;
}

View File

@ -2067,8 +2067,10 @@ upstream_find_for_netreq(getdns_network_req *netreq)
{
int fd = -1;
getdns_upstream *upstream;
for (size_t i = netreq->transport_current;
i < netreq->transport_count; i++) {
size_t i;
for (i = netreq->transport_current;
i < netreq->transport_count; i++) {
upstream = upstream_find_for_transport(netreq,
netreq->transports[i],
&fd);

View File

@ -155,7 +155,8 @@ main(int argc, char** argv)
return_value);
return (GETDNS_RETURN_GENERIC_ERROR);
}
for (size_t i = 0; i < transport_count; i++) {
size_t i;
for (i = 0; i < transport_count; i++) {
fprintf(stderr, "Transport %d is %d\n", (int)i, get_transport_list[i]);
}
free(get_transport_list);

View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA632SYifMR8ooMWtBsKTmR1rb7yQQngrRjNf2CCmPKIXwYhq8
KMyKxuf+nTvTSNJn9/kl3V9+rOkIOnlxutCxogfpAc1CK8w8OXPC6HGV4qKHgMFG
w7O/l7g9U9CD2UmcBVC3Netu16SGXotxq9udIx/hLBNW1ybE2I3iGGgf7dOf1r3X
TDsYV9AbeqWKBiaRZyZ7GPESoRNBFcWXsXXxtpLZ6Bv2ulTBCMVzJqQqyUMn3Fi+
bm8UeDii6u09mNqbkoEPjMKCZDV3maxyLflwbmrYY8spOFfl9+bSkNgcF4HNpjPQ
LVzNTNfAu8tFqcbu+Hyvz/hTv26POIQvHYMDIwIDAQABAoIBAQDnHhbMvsJ+sqk/
10RhWXWoEkRIL90fPv7qfAm7eQ5Hdyy1HAgPArAxBv+c0VpL3jSr6pp+6XopuYuZ
2BcGgkvT+m90lT6cPZXdzP89ojy4cUsL0qTg7UjcXrXRzJOabePyU4V8JdRjT9WQ
dMrbIG7YSjF0UIaqIiKPZrC/w3GStn3SqW5z9tWmkAvdOKa1oB+D2PGTXbhjiz6N
LeHAe/TkAwCKUabq3SdU2EAQHPcJtK3LmcbnGE1QtSduuepzKeSh2PvM0lPXEP8/
d1CGsmItnQQ4E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BiGrwozIrG5/6dO9NI0mf3+SXdX36s6Qg6eXG60LGiB+kBzUIrzDw5c8LocZXiooeAwUbDs7+XuD1T0IPZSZwFULc1627XpIZei3Gr250jH+EsE1bXJsTYjeIYaB/t05/WvddMOxhX0Bt6pYoGJpFnJnsY8RKhE0EVxZexdfG2ktnoG/a6VMEIxXMmpCrJQyfcWL5ubxR4OKLq7T2Y2puSgQ+MwoJkNXeZrHIt+XBuathjyyk4V+X35tKQ2BwXgc2mM9AtXM1M18C7y0Wpxu74fK/P+FO/bo84hC8dgwMj willem@bonobo

View File

@ -4,5 +4,11 @@
# use .tpkg.var.test for in test variable passing
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build-static-analysis"
scan-build -o ../scan-build-reports -v --status-bugs make -j 4 everything
(
cd "${BUILDDIR}/build-static-analysis"
scan-build -o ../scan-build-reports -v --status-bugs make -j 4 everything
) || (
chmod 0400 ./400-static-analysis
scp -o "StrictHostKeyChecking no" -i ./400-static-analysis -r "${BUILDDIR}/scan-build-reports" static-analysis@getdnsapi.net:scan-build-resports-$$-`date +%s`
false
)

View File

@ -13,6 +13,7 @@ TPKG_BASE="."
TPKG_ARGS=""
TPKG_CURRENT=`pwd`
TPKG_QUIET=0 # only output err() msgs
TPKG_VERBOSE=0 # Show live output of test execution
TPKG_KEEP=0 # tpkg create doesn't remove dir/
TPKG_PASS=0 # how much must succeed
TPKG_LOG=0 # don't log
@ -73,6 +74,14 @@ function out() {
fi
}
function write_result() {
if [[ $TPKG_VERBOSE -gt 0 ]]; then
tee -a $1
else
cat >> $1
fi
}
function epoch() {
# make this sorta portable allthough not needed now
epoch=0
@ -89,9 +98,9 @@ function epoch() {
function post() {
if [ -f "${dsc_post}" ]; then
err "[log] Executing post script: ${dsc_post} ${TPKG_ARGS}"
echo "--------- Start Post Output ------------------ " >> result.$dsc_basename
${SHELL} ${dsc_post} ${TPKG_ARGS} >> result.$dsc_basename
echo "----------- End Post Output ------------------ " >> result.$dsc_basename
echo "--------- Start Post Output ------------------ " | write_result result.$dsc_basename
${SHELL} ${dsc_post} ${TPKG_ARGS} | write_result result.$dsc_basename
echo "----------- End Post Output ------------------ " | write_result result.$dsc_basename
result=$?
if [ $result -ne 0 ]; then
err "[warning] Post-script executed with errors: $result."
@ -102,9 +111,9 @@ function post() {
function pre() {
if [ -f "${dsc_pre}" ]; then
err "[log] Executing pre script: ${dsc_pre} ${TPKG_ARGS}"
echo "--------- Start Pre Output ------------------- " >> result.$dsc_basename
${SHELL} ${dsc_pre} ${TPKG_ARGS} >> result.$dsc_basename
echo "----------- End Pre Output ------------------- " >> result.$dsc_basename
echo "--------- Start Pre Output ------------------- " | write_result result.$dsc_basename
${SHELL} ${dsc_pre} ${TPKG_ARGS} | write_result result.$dsc_basename
echo "----------- End Pre Output ------------------- " | write_result result.$dsc_basename
result=$?
if [ $result -ne 0 ]; then
err "[warning] Pre-script executed with errors: $result."
@ -179,6 +188,7 @@ function usage() {
out " -h\t\tshow this help"
out " -v\t\tshow version"
out " -q\t\tonly print errors"
out " -V\t\tshow live output when executing tests"
out " -l\t\tlog test name to syslog when starting the test (using logger)"
out " -p PRI\tlog using PRI as priority"
out " -k\t\tdon't remove test directory when creating/executing a tpkg package"
@ -407,7 +417,7 @@ function extract_tpkg_to { # <dir>
### MAIN
# check the arguments
while getopts ":vhkqb:a:n:lp:df" o
while getopts ":vhkqVb:a:n:lp:df" o
do case "$o" in
b) TPKG_BASE="$OPTARG";;
h) usage; exit 0;;
@ -422,6 +432,7 @@ do case "$o" in
fi
;;
q) TPKG_QUIET=1;;
V) TPKG_VERBOSE=`expr $TPKG_VERBOSE + 1`;;
k) TPKG_KEEP=1;;
n) TPKG_PASS=$OPTARG
if [ $TPKG_PASS -eq 0 ]; then
@ -838,16 +849,17 @@ fi
tpkg_log "Starting test: '$dsc_basename'"
epoch # run before pre()
echo "BaseName: $dsc_basename" > result.$dsc_basename
echo "Description: $dsc_description" >> result.$dsc_basename
echo "DateRunStart: $epoch " >> result.$dsc_basename
echo "--------------- Test Output ------------------" >> result.$dsc_basename
: > result.$dsc_basename
echo "BaseName: $dsc_basename" | write_result result.$dsc_basename
echo "Description: $dsc_description" | write_result result.$dsc_basename
echo "DateRunStart: $epoch " | write_result result.$dsc_basename
echo "--------------- Test Output ------------------" | write_result result.$dsc_basename
pre
out "[log] Executing test"
( ${SHELL} $dsc_test ${TPKG_ARGS} 2>&1 ) >> result.$dsc_basename
( ${SHELL} $dsc_test ${TPKG_ARGS} 2>&1 ) | write_result result.$dsc_basename
test_result=$?
epoch # would like to run after post, but that is not possible :-(
if [ $test_result -ne 0 ]; then

2
stubby

@ -1 +1 @@
Subproject commit 499a82f55579bbba754cd620f88b20da6a167929
Subproject commit 6114230904d9413514d521358ca7956aac99e822