Skip to contentSkip to conversation

dnsproxy: some initial refactoring and integration test

PATCH In review [email protected] 2 participants 15 messages Feb 17, 2022 – Mar 4, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

These are the first steps towards a bigger effort to refactor the dnsproxy code. Some smaller fixes of compiler warnings and refactorings are already included. Mostly this adds an integration test facility though that allows to easily test the basic code paths of the dnsproxy without the need for root privileges or extensive configuration. With this future changes to the codebase can be more easily checked for regressions.

#1 lore raw

PATCH 1/7 dnsproxy: remove unused domain parameter from `remove_server()`

From: Matthias Gerstner <[email protected]>

---
 src/dnsproxy.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
src/dnsproxy.c +3 -4
index cf1d36c7..ad8c5da2 100644
@@ -2843,8 +2843,7 @@ int __connman_dnsproxy_append(int index, const char *domain,
 	return 0;
 }
 
-static void remove_server(int index, const char *domain,
-			const char *server, int protocol)
+static void remove_server(int index, const char *server, int protocol)
 {
 	struct server_data *data;
 	GSList *list;
@@ -2885,8 +2884,8 @@ int __connman_dnsproxy_remove(int index, const char *domain,
 	if (g_str_equal(server, "::1"))
 		return -ENODEV;
 
-	remove_server(index, domain, server, IPPROTO_UDP);
-	remove_server(index, domain, server, IPPROTO_TCP);
+	remove_server(index, server, IPPROTO_UDP);
+	remove_server(index, server, IPPROTO_TCP);
 
 	return 0;
 }
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/7 dnsproxy: remove unnecessarily shadowed variable

In reply to [email protected]

From: Matthias Gerstner <[email protected]>

---
 src/dnsproxy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/dnsproxy.c +1 -1
index ad8c5da2..b195f447 100644
@@ -2855,7 +2855,7 @@ static void remove_server(int index, const char *server, int protocol)
 	destroy_server(data);
 
 	for (list = server_list; list; list = list->next) {
-		struct server_data *data = list->data;
+		data = list->data;
 
 		if (data->index != -1 && data->enabled == true)
 			return;
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/7 dnsproxy: protocol_offset: remove error return case and return size_t

In reply to [email protected]

From: Matthias Gerstner <[email protected]>

There is never any socket created that is not UDP or TCP, so this error should never occur unless some memory corruption or similar occured. Therefore abort() on unexpected values instead.

This simplifies the calling code since the error case no longer needs to be covered (which can also be dangerous when forgotten, because then negative error codes are used in calculations).

---
 src/dnsproxy.c | 41 ++++++++++++++---------------------------
 1 file changed, 14 insertions(+), 27 deletions(-)
src/dnsproxy.c +14 -27
index b195f447..d04057fa 100644
@@ -233,7 +233,7 @@ static guint16 get_id(void)
 	return rand;
 }
 
-static int protocol_offset(int protocol)
+static size_t protocol_offset(int protocol)
 {
 	switch (protocol) {
 	case IPPROTO_UDP:
@@ -243,9 +243,9 @@ static int protocol_offset(int protocol)
 		return 2;
 
 	default:
-		return -EINVAL;
+		// this should never happen
+		abort();
 	}
-
 }
 
 /*
@@ -480,13 +480,11 @@ static void send_response(int sk, unsigned char *buf, size_t len,
 				int protocol)
 {
 	struct domain_hdr *hdr;
-	int err, offset = protocol_offset(protocol);
+	int err;
+	size_t offset = protocol_offset(protocol);
 
 	debug("sk %d", sk);
 
-	if (offset < 0)
-		return;
-
 	if (len < sizeof(*hdr) + offset)
 		return;
 
@@ -802,16 +800,12 @@ static struct cache_entry *cache_check(gpointer request, int *qtype, int proto)
 	struct cache_entry *entry;
 	struct domain_question *q;
 	uint16_t type;
-	int offset, proto_offset;
+	int offset;
 
 	if (!request)
 		return NULL;
 
-	proto_offset = protocol_offset(proto);
-	if (proto_offset < 0)
-		return NULL;
-
-	question = request + proto_offset + 12;
+	question = request + protocol_offset(proto) + 12;
 
 	offset = strlen(question) + 1;
 	q = (void *) (question + offset);
@@ -1383,7 +1377,7 @@ static int reply_query_type(unsigned char *msg, int len)
 static int cache_update(struct server_data *srv, unsigned char *msg,
 			unsigned int msg_len)
 {
-	int offset = protocol_offset(srv->protocol);
+	size_t offset = protocol_offset(srv->protocol);
 	int err, qlen, ttl = 0;
 	uint16_t answers = 0, type = 0, class = 0;
 	struct domain_hdr *hdr = (void *)(msg + offset);
@@ -1411,10 +1405,7 @@ static int cache_update(struct server_data *srv, unsigned char *msg,
 		next_refresh = current_time + 30;
 	}
 
-	if (offset < 0)
-		return 0;
-
-	debug("offset %d hdr %p msg %p rcode %d", offset, hdr, msg, hdr->rcode);
+	debug("offset %zd hdr %p msg %p rcode %d", offset, hdr, msg, hdr->rcode);
 
 	/* Continue only if response code is 0 (=ok) */
 	if (hdr->rcode != ns_r_noerror)
@@ -1678,17 +1669,14 @@ static int ns_resolv(struct server_data *server, struct request_data *req,
 		char *domain;
 		unsigned char alt[1024];
 		struct domain_hdr *hdr = (void *) &alt;
-		int altlen, domlen, offset;
+		int altlen, domlen;
+		size_t offset = protocol_offset(server->protocol);
 
 		domain = list->data;
 
 		if (!domain)
 			continue;
 
-		offset = protocol_offset(server->protocol);
-		if (offset < 0)
-			return offset;
-
 		domlen = strlen(domain) + 1;
 		if (domlen < 5)
 			return -EINVAL;
@@ -1947,13 +1935,12 @@ static int forward_dns_reply(unsigned char *reply, int reply_len, int protocol,
 {
 	struct domain_hdr *hdr;
 	struct request_data *req;
-	int dns_id, sk, err, offset = protocol_offset(protocol);
+	int dns_id, sk, err;
+	size_t offset = protocol_offset(protocol);
 
-	if (offset < 0)
-		return offset;
 	if (reply_len < 0)
 		return -EINVAL;
-	if (reply_len < offset + 1)
+	if ((size_t)reply_len < offset + 1)
 		return -EINVAL;
 	if ((size_t)reply_len < sizeof(struct domain_hdr))
 		return -EINVAL;
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH 3/7] dnsproxy: protocol_offset: remove error return case and return size_t

Quoted 27 lines · On Thu, Feb 17, 2022 at 12:31:09PM +0100, [email protected] wrote:

From: Matthias Gerstner <[email protected]>

There is never any socket created that is not UDP or TCP, so this error should never occur unless some memory corruption or similar occured. Therefore abort() on unexpected values instead.

This simplifies the calling code since the error case no longer needs to be covered (which can also be dangerous when forgotten, because then negative error codes are used in calculations).

---
 src/dnsproxy.c | 41 ++++++++++++++---------------------------
 1 file changed, 14 insertions(+), 27 deletions(-)
src/dnsproxy.c +1 -1
index b195f447..d04057fa 100644
@@ -233,7 +233,7 @@ static guint16 get_id(void)
 	return rand;
 }
 
-static int protocol_offset(int protocol)
+static size_t protocol_offset(int protocol)
 {
 	switch (protocol) {
 	case IPPROTO_UDP:

src/dnsproxy.c static int protocol_offset(int protocol) · line 246

Quoted 5 lines
src/dnsproxy.c +1 -1
@@ -243,9 +243,9 @@ static int protocol_offset(int protocol)
 		return 2;
 
 	default:
-		return -EINVAL;
+		// this should never happen

We always use /* */ comment style. I've updated this accordingly.

#5 lore raw

PATCH 4/7 .gitignore: also ignore backup configure script

In reply to [email protected]

From: Matthias Gerstner <[email protected]>

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index cd7d8810..4e0c0aa7 100644
@@ -15,6 +15,7 @@ config.log
 config.status
 config.sub
 configure
+configure~
 depcomp
 compile
 install-sh
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH 4/7] .gitignore: also ignore backup configure script

Quoted 11 lines · On Thu, Feb 17, 2022 at 12:31:10PM +0100, [email protected] wrote:

From: Matthias Gerstner <[email protected]>

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +0 -0
index cd7d8810..4e0c0aa7 100644

.gitignore config.log · line 18

Quoted 4 lines
.gitignore +1 -0
@@ -15,6 +15,7 @@ config.log
 config.status
 config.sub
 configure
+configure~

I have changed this to a more generic *~

#7 lore raw

PATCH 5/7 dnsproxy: support programmatic configuration of the default listen port

In reply to [email protected]

From: Matthias Gerstner <[email protected]>

This way a test instance of dnsproxy can be setup that listens on an unprivileged port for easier testing as non-root.

---
 src/connman.h  |  1 +
 src/dnsproxy.c | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
src/connman.h +1 -0
index 68176086..909b53ae 100644
@@ -983,6 +983,7 @@ void __connman_dnsproxy_remove_listener(int index);
 int __connman_dnsproxy_append(int index, const char *domain, const char *server);
 int __connman_dnsproxy_remove(int index, const char *domain, const char *server);
 int __connman_dnsproxy_set_mdns(int index, bool enabled);
+void __connman_dnsproxy_set_listen_port(unsigned int port);
 
 int __connman_6to4_probe(struct connman_service *service);
 void __connman_6to4_remove(struct connman_ipconfig *ipconfig);
src/dnsproxy.c +8 -2
index d04057fa..f862c788 100644
@@ -223,6 +223,7 @@ static GHashTable *listener_table = NULL;
 static time_t next_refresh;
 static GHashTable *partial_tcp_req_table;
 static guint cache_timer = 0;
+static in_port_t dns_listen_port = 53;
 
 static guint16 get_id(void)
 {
@@ -3704,7 +3705,7 @@ static GIOChannel *get_listener(int family, int protocol, int index)
 	if (family == AF_INET6) {
 		memset(&s.sin6, 0, sizeof(s.sin6));
 		s.sin6.sin6_family = AF_INET6;
-		s.sin6.sin6_port = htons(53);
+		s.sin6.sin6_port = htons(dns_listen_port);
 		slen = sizeof(s.sin6);
 
 		if (__connman_inet_get_interface_address(index,
@@ -3721,7 +3722,7 @@ static GIOChannel *get_listener(int family, int protocol, int index)
 	} else if (family == AF_INET) {
 		memset(&s.sin, 0, sizeof(s.sin));
 		s.sin.sin_family = AF_INET;
-		s.sin.sin_port = htons(53);
+		s.sin.sin_port = htons(dns_listen_port);
 		slen = sizeof(s.sin);
 
 		if (__connman_inet_get_interface_address(index,
@@ -4050,3 +4051,8 @@ void __connman_dnsproxy_cleanup(void)
 	if (ipv6_resolve)
 		g_resolv_unref(ipv6_resolve);
 }
+
+void __connman_dnsproxy_set_listen_port(unsigned int port)
+{
+	dns_listen_port = port;
+}
Signature · 1 line
2.34.1
#8 lore raw

PATCH 6/7 dnsproxy-test: support command line specification of dnsproxy port

In reply to [email protected]

From: Matthias Gerstner <[email protected]>

This way a dnsproxy running on an unprivileged port can be tested.

---
 tools/dnsproxy-test.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
tools/dnsproxy-test.c +9 -2
index 371e2e23..7660db71 100644
@@ -99,6 +99,8 @@ static unsigned char msg_invalid[] = {
 	0x31, 0xC0, /* tran id */
 };
 
+static const char *dns_port = "53";
+
 static int create_tcp_socket(int family)
 {
 	int sk, err;
@@ -139,7 +141,7 @@ static int connect_tcp_socket(char *server)
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_family = AF_UNSPEC;
 	hints.ai_flags = AI_NUMERICSERV | AI_NUMERICHOST;
-	getaddrinfo(server, "53", &hints, &rp);
+	getaddrinfo(server, dns_port, &hints, &rp);
 
 	sk = create_tcp_socket(rp->ai_family);
 	err = sk;
@@ -201,7 +203,7 @@ static int connect_udp_socket(char *server, struct sockaddr *sa,
 	hints.ai_socktype = SOCK_DGRAM;
 	hints.ai_family = AF_UNSPEC;
 	hints.ai_flags = AI_NUMERICSERV | AI_NUMERICHOST;
-	getaddrinfo(server, "53", &hints, &rp);
+	getaddrinfo(server, dns_port, &hints, &rp);
 
 	sk = create_udp_socket(rp->ai_family);
 	err = sk;
@@ -430,6 +432,11 @@ int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
 
+	if (argc == 2) {
+		// alternative dns port
+		dns_port = argv[1];
+	}
+
 	g_test_add_func("/dnsproxy/ipv4 udp msg",
 			test_ipv4_udp_msg);
 
Signature · 1 line
2.34.1
#9 lore raw

PATCH 7/7 dnsproxy: add standalone test version of dnsproxy and a test script for it

In reply to [email protected]

From: Matthias Gerstner <[email protected]>

Since dnsproxy is not really modular this requires building complete connman minus the original main function. It makes testing a lot easier though, since this standalone version doesn't require root privileges or configuration aspects like the D-Bus connection etc.

Add this as EXTRA_PROGRAMS, not as CHECK_PROGRAMS, because the test might need some specific settings to work (e.g. a working /etc/resolv.conf with domain entry).

---
 Makefile.am                 |  13 +++
 tools/dnsproxy-simple-test  | 112 ++++++++++++++++++++++++++
 tools/dnsproxy-standalone.c | 154 ++++++++++++++++++++++++++++++++++++
 3 files changed, 279 insertions(+)
 create mode 100755 tools/dnsproxy-simple-test
 create mode 100644 tools/dnsproxy-standalone.c
Makefile.am +13 -0
index e5718b19..ea532071 100644
@@ -106,6 +106,7 @@ builtin_cflags =
 
 noinst_PROGRAMS =
 bin_PROGRAMS =
+EXTRA_PROGRAMS =
 
 unit_objects =
 
@@ -412,6 +413,18 @@ endif
 tools_dnsproxy_test_SOURCES = tools/dnsproxy-test.c
 tools_dnsproxy_test_LDADD = @GLIB_LIBS@
 
+tools_dnsproxy_standalone_CFLAGS = $(src_connmand_CFLAGS) -I$(srcdir)/src
+tools_dnsproxy_standalone_SOURCES = tools/dnsproxy-standalone.c $(src_connmand_SOURCES)
+# for EXTRA_PROGRAMS the BUILT_SOURCES aren't automatically added as
+# dependency, so let's do it explicitly
+tools/dnsproxy-standalone.c: $(BUILT_SOURCES)
+tools_dnsproxy_standalone_LDADD = $(src_connmand_LDADD)
+# pass -zmuldefs to let the linker tolerate the duplicate definition of
+# main(), the first definition from dnsproxy-standalone should be used
+tools_dnsproxy_standalone_LDFLAGS = $(src_connmand_LDFLAGS) -Wl,-zmuldefs
+
+EXTRA_PROGRAMS += tools/dnsproxy-standalone
+
 endif
 
 test_scripts = test/get-state test/list-services \
tools/dnsproxy-simple-test new file +112 -0

112 lines not on this page · raw message

tools/dnsproxy-standalone.c new file +154 -0

154 lines not on this page · raw message

Signature · 1 line
2.34.1
#10 lore raw

Re: [PATCH 7/7] dnsproxy: add standalone test version of dnsproxy and a test script for it

Hi Matthias,

Makefile.am endif · line 426

Quoted 11 lines · On Thu, Feb 17, 2022 at 12:31:13PM +0100, [email protected] wrote:
Makefile.am +11 -0
+tools_dnsproxy_standalone_CFLAGS = $(src_connmand_CFLAGS) -I$(srcdir)/src
+tools_dnsproxy_standalone_SOURCES = tools/dnsproxy-standalone.c $(src_connmand_SOURCES)
+# for EXTRA_PROGRAMS the BUILT_SOURCES aren't automatically added as
+# dependency, so let's do it explicitly
+tools/dnsproxy-standalone.c: $(BUILT_SOURCES)
+tools_dnsproxy_standalone_LDADD = $(src_connmand_LDADD)
+# pass -zmuldefs to let the linker tolerate the duplicate definition of
+# main(), the first definition from dnsproxy-standalone should be used
+tools_dnsproxy_standalone_LDFLAGS = $(src_connmand_LDFLAGS) -Wl,-zmuldefs
+
+EXTRA_PROGRAMS += tools/dnsproxy-standalone

I would move this part just under the other tools section. These 'tools' are not supposed to be installed.

Quoted 34 lines
tools/dnsproxy-simple-test new file +31 -0
@@ -0,0 +1,112 @@
+#!/bin/bash
+
+# this script runs the dnsproxy-standalone test program and runs a couple of
+# standard DNS queries against it, using the currently configured DNS server
+# in the system as dnsproxy configuration.
+
+echoerr() {
+	echo $@ 1>&2
+	exit 1
+}
+
+while [ $# -gt 0 ]; do
+	case "$1" in
+	"--valgrind")
+		VALGRIND=`which valgrind`
+		if [ -z "$VALGRIND" ]; then
+			echoerr "no valgrind executable found"
+		fi
+		;;
+	"-h")
+		echo "$0 [--valgrind]"
+		echo "--valgrind: run dnsproxy-standalone in valgrind"
+		exit 2
+		;;
+	*)
+		echoerr "Unknown argument $1"
+		;;
+	esac
+	shift
+done
+

tools/dnsproxy-simple-test line 41

Quoted 10 lines
tools/dnsproxy-simple-test new file +10 -0
+if [ -e "Makefile" ]; then
+	BUILDROOT="$PWD"
+else
+	if [ ! -n "$BUILDROOT" ]; then
+		echoerr "You need to set the BUILDROOT environment variable or run this script from the connman build tree root"
+	fi
+
+	pushd "$BUILDROOT" >/dev/null || echoerr "couldn't enter $BUILDROOT"
+fi
+make tools/dnsproxy-standalone || echoerr "failed to build dnsproxy-standalone"

Just build this tool along with the other tools. No need for this special casing IMO. It's also not working in my setup:

$ ./tools/dnsproxy-simple-test
gcc -Wall -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O0 -U_FORTIFY_SOURCE -g    tools/dnsproxy-standalone.c   -o tools/dnsproxy-standalone
tools/dnsproxy-standalone.c:7:10: fatal error: glib.h: No such file or directory
    7 | #include <glib.h>
      |          ^~~~~~~~

Thanks,
Daniel

#11 lore raw

As discussed off-list, adding this test variant of connmand to noinst_PROGRAMS means that all major object files will be built twice by default, considerably increasing the build time with no benefit for most users.

Therefore only add the test program if --enable-test is set during configure time. Pass this switch in bootstrap-configure to allow developers to catch errors in the test source code.

#12 lore raw

PATCH 1/1 dnsproxy: add standalone test version of dnsproxy and a test script for it

From: Matthias Gerstner <[email protected]>

Since dnsproxy is not really modular this requires building complete connman minus the original main function. It makes testing a lot easier though, since this standalone version doesn't require root privileges or configuration aspects like the D-Bus connection etc.

Only build this if --enable-test is given, otherwise complete connmand would be built twice just by typing make. Also don't add this to CHECK_PROGRAMS, because the test could need some specific settings to work (e.g. a working /etc/resolv.conf with domain entry).

Add --enable-test to bootstrap-configure such that developers notice possible build errors introduced in the regression test build.

---
 Makefile.am                 |  13 +++
 bootstrap-configure         |   3 +-
 tools/dnsproxy-simple-test  | 112 ++++++++++++++++++++++++++
 tools/dnsproxy-standalone.c | 154 ++++++++++++++++++++++++++++++++++++
 4 files changed, 281 insertions(+), 1 deletion(-)
 create mode 100755 tools/dnsproxy-simple-test
 create mode 100644 tools/dnsproxy-standalone.c
Makefile.am +13 -0
index e5718b19..5ca8e6be 100644
@@ -434,6 +434,19 @@ test_scripts += test/vpn-connect test/vpn-disconnect test/vpn-get \
 if TEST
 testdir = $(pkglibdir)/test
 test_SCRIPTS = $(test_scripts)
+
+tools_dnsproxy_standalone_CFLAGS = $(src_connmand_CFLAGS) -I$(srcdir)/src
+tools_dnsproxy_standalone_SOURCES = tools/dnsproxy-standalone.c $(src_connmand_SOURCES)
+# for EXTRA_PROGRAMS the BUILT_SOURCES aren't automatically added as
+# dependency, so let's do it explicitly
+tools/dnsproxy-standalone.c: $(BUILT_SOURCES)
+tools_dnsproxy_standalone_LDADD = $(src_connmand_LDADD)
+# pass -zmuldefs to let the linker tolerate the duplicate definition of
+# main(), the first definition from dnsproxy-standalone should be used
+tools_dnsproxy_standalone_LDFLAGS = $(src_connmand_LDFLAGS) -Wl,-zmuldefs
+
+noinst_PROGRAMS += tools/dnsproxy-standalone
+
 endif
 
 EXTRA_DIST += $(test_scripts)
bootstrap-configure +2 -1
index 3f697987..ed5ecd78 100755
@@ -18,4 +18,5 @@ fi
 		--enable-vpnc=builtin \
 		--enable-session-policy-local=builtin \
 		--enable-nmcompat \
-		--enable-polkit $*
+		--enable-polkit $* \
+		--enable-test
tools/dnsproxy-simple-test new file +112 -0

112 lines not on this page · raw message

tools/dnsproxy-standalone.c new file +154 -0

154 lines not on this page · raw message

Signature · 1 line
2.34.1
#13 lore raw

Re: [PATCH] dnsproxy: add standalone test version of dnsproxy and a test script for it

Hi Matthias,

Quoted 6 lines · On Mon, Feb 28, 2022 at 02:19:21PM +0100, [email protected] wrote:

if TEST
testdir = $(pkglibdir)/test
test_SCRIPTS = $(test_scripts)

Makefile.am +3 -0
+
+tools_dnsproxy_standalone_CFLAGS = $(src_connmand_CFLAGS) -I$(srcdir)/src
+tools_dnsproxy_standalone_SOURCES = tools/dnsproxy-standalone.c $(src_connmand_SOURCES)

Makefile.am test_scripts += test/vpn-connect test/vpn-disconnect test/vpn-get \ · line 449

Quoted 10 lines
Makefile.am +10 -0
+# for EXTRA_PROGRAMS the BUILT_SOURCES aren't automatically added as
+# dependency, so let's do it explicitly
+tools/dnsproxy-standalone.c: $(BUILT_SOURCES)
+tools_dnsproxy_standalone_LDADD = $(src_connmand_LDADD)
+# pass -zmuldefs to let the linker tolerate the duplicate definition of
+# main(), the first definition from dnsproxy-standalone should be used
+tools_dnsproxy_standalone_LDFLAGS = $(src_connmand_LDFLAGS) -Wl,-zmuldefs
+
+noinst_PROGRAMS += tools/dnsproxy-standalone
+

I wrapped this section into an addition 'if INTERNAL_DNS_BACKEND' because it would fail to build for SYSTEMD_RESOLVED_DNS_BACKEND

tools/dnsproxy-standalone.c line 139

Quoted 5 lines
tools/dnsproxy-standalone.c new file +5 -0
+	// we need to trick a bit to make the server entry enter "enabled"
+	// state in dnsproxy. Appending and removing an arbitrary entry causes
+	// "enable_fallback()" to be called which does what we want. Doesn't
+	// make much sense but it is good enough for the standalone server at
+	// the moment.

Changed this to /* ... */

Patch applied.

Thanks
Daniel

#14 lore raw
In reply to [email protected]

Hi Matthias,

Quoted 6 lines · On Thu, Feb 17, 2022 at 12:31:06PM +0100, [email protected] wrote:

These are the first steps towards a bigger effort to refactor the dnsproxy code. Some smaller fixes of compiler warnings and refactorings are already included. Mostly this adds an integration test facility though that allows to easily test the basic code paths of the dnsproxy without the need for root privileges or extensive configuration. With this future changes to the codebase can be more easily checked for regressions.

Nice contribution. I've updated small nitpicks and applied patch 1-6. I think patch 7 should just hook up into the tools build target and it doesn't need any special Makefile hackery.

Thanks,
Daniel