From 62750b505fbac4d8da315848ebc904fa66cbc04d Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 28 Jun 2016 14:39:51 +0200 Subject: [PATCH 1/2] Own root server with TCP only full recursion test --- src/test/check_getdns_context_set_dns_transport.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/check_getdns_context_set_dns_transport.h b/src/test/check_getdns_context_set_dns_transport.h index bcad502d..2f893b35 100644 --- a/src/test/check_getdns_context_set_dns_transport.h +++ b/src/test/check_getdns_context_set_dns_transport.h @@ -250,6 +250,8 @@ struct getdns_context *context = NULL; struct getdns_dict *response = NULL; struct getdns_dict *extensions = getdns_dict_create(); + struct getdns_list *root_servers = getdns_list_create(); + struct getdns_bindata nlnetlabs_root = { 4, (void *)"\xB9\x31\x8D\x25" }; uint32_t status; uint32_t type; uint32_t tc; @@ -264,6 +266,10 @@ /* Re-do over TCP */ ASSERT_RC(getdns_dict_set_int(extensions,"return_call_reporting", GETDNS_EXTENSION_TRUE), GETDNS_RETURN_GOOD, "Return code from getdns_dict_set_int()"); + ASSERT_RC(getdns_list_set_bindata(root_servers,0,&nlnetlabs_root), + GETDNS_RETURN_GOOD, "Return code from getdns_list_set_bindata()"); + ASSERT_RC(getdns_context_set_dns_root_servers(context, root_servers), + GETDNS_RETURN_GOOD, "Return code from getdns_context_set_dns_root_servers()"); ASSERT_RC(getdns_context_set_dns_transport(context, GETDNS_TRANSPORT_TCP_ONLY), GETDNS_RETURN_GOOD, "Return code from getdns_context_set_dns_transport()"); ASSERT_RC(getdns_context_set_edns_maximum_udp_payload_size(context, 512), @@ -283,6 +289,8 @@ } CONTEXT_DESTROY; + getdns_dict_destroy(extensions); + getdns_list_destroy(root_servers); } END_TEST From 080b338a8f0e9573c5789814dcf2abba80d6ec6c Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 29 Jun 2016 12:32:51 +0200 Subject: [PATCH 2/2] Explain own root server necessity in transport_7 Also query for the consistently large record and not the DNSKEY (which is sometimes large and sometimes not) --- .../check_getdns_context_set_dns_transport.h | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/test/check_getdns_context_set_dns_transport.h b/src/test/check_getdns_context_set_dns_transport.h index 2f893b35..8e2b3610 100644 --- a/src/test/check_getdns_context_set_dns_transport.h +++ b/src/test/check_getdns_context_set_dns_transport.h @@ -244,14 +244,25 @@ START_TEST (getdns_context_set_dns_transport_recursing_7) { /* - * Call getdns_context_set_dns_transport() with value = GETDNS_TRANSPORT_TCP_ONLY - * expect: Response returned - */ + * Call getdns_context_set_dns_transport() with value = GETDNS_TRANSPORT_TCP_ONLY + * expect: Response returned + */ struct getdns_context *context = NULL; struct getdns_dict *response = NULL; struct getdns_dict *extensions = getdns_dict_create(); + + /* + * Not all servers in the path to large.getdnsapi.net seem to support + * TCP consistently. Many (root) servers are anycasted which decreases + * reliability of TCP availability (as we've seen in practice). + * To mitigate we provide our own root server for which we are sure that + * it supports TCP. The .net authoritative server are still out of our + * control tough. But because they are managed by a single party I + * suspect them to be a bit more reliable. + */ struct getdns_list *root_servers = getdns_list_create(); struct getdns_bindata nlnetlabs_root = { 4, (void *)"\xB9\x31\x8D\x25" }; + uint32_t status; uint32_t type; uint32_t tc; @@ -274,7 +285,7 @@ GETDNS_RETURN_GOOD, "Return code from getdns_context_set_dns_transport()"); ASSERT_RC(getdns_context_set_edns_maximum_udp_payload_size(context, 512), GETDNS_RETURN_GOOD, "Return code from getdns_context_set_edns_maximum_udp_payload_size()"); - ASSERT_RC(getdns_general_sync(context, "getdnsapi.net", 48, extensions, &response), + ASSERT_RC(getdns_general_sync(context, "large.getdnsapi.net", GETDNS_RRTYPE_TXT, extensions, &response), GETDNS_RETURN_GOOD, "Return code from getdns_general_sync()"); ASSERT_RC(getdns_dict_get_int(response, "status", &status), @@ -319,7 +330,7 @@ GETDNS_RETURN_GOOD, "Return code from getdns_context_set_dns_transport()"); ASSERT_RC(getdns_context_set_edns_maximum_udp_payload_size(context, 512), GETDNS_RETURN_GOOD, "Return code from getdns_context_set_edns_maximum_udp_payload_size()"); - ASSERT_RC(getdns_general_sync(context, "getdnsapi.net", 48, extensions, &response), + ASSERT_RC(getdns_general_sync(context, "large.getdnsapi.net", GETDNS_RRTYPE_TXT, extensions, &response), GETDNS_RETURN_GOOD, "Return code from getdns_general_sync()"); ASSERT_RC(getdns_dict_get_int(response, "status", &status),