  	instance->config.relayaddr.sin_family = AF_INET;
  	instance->config.relayaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
  	/* Default value can be checked in run-time, but I doubt anyone needs that.
-@@ -164,6 +165,16 @@ static int redsocks_onexit(parser_section *section)
- 	 */
- 	redsocks_instance *instance = section->data;
+@@ -171,6 +172,16 @@ static int redsocks_onexit(parser_section *section)
+ 	instance->config.bindaddr.sin_port = htons(instance->config.bindaddr.sin_port);
+ 	instance->config.relayaddr.sin_port = htons(instance->config.relayaddr.sin_port);
 
-+	//Force some values that the OS depends on
++	// Force some values that the OS depends on
 +	if (instance->config.bindaddr.sin_addr.s_addr != inet_addr("10.114.103.1")) {
 +		log_error(LOG_WARNING, "Overwriting `redsocks:local_ip` entry: it needs to match OS' iptables configuration.\n");
 +		instance->config.bindaddr.sin_addr.s_addr = inet_addr("10.114.103.1");
 +	}
-+	if (instance->config.bindaddr.sin_port != 12345) {
++	if (instance->config.bindaddr.sin_port != htons(12345)) {
 +		log_error(LOG_WARNING, "Overwriting `redsocks:local_port` entry: it needs to match OS' iptables configuration.\n");
-+		instance->config.bindaddr.sin_port = 12345;
++		instance->config.bindaddr.sin_port = htons(12345);
 +	}
 +
- 	section->data = NULL;
- 	for (parser_entry *entry = &section->entries[0]; entry->key; entry++)
- 		entry->addr = NULL;
+ 	if (instance->config.type) {
+ 		relay_subsys **ss;
+ 		FOREACH(ss, relay_subsystems) {
 --
 2.7.4
 

From a05247037a5d7be34d6df83411df08fe0f176210 Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei@resin.io>
Date: Fri, 20 Apr 2018 13:06:14 +0100
Subject: [PATCH] Add OS dependent default configuration values

 		parser_error(section->context, "`max_accept_backoff` must be positive, 0 ms is too low");
 		return -1;
diff --git a/dnsu2t.c b/dnsu2t.c
index bae4a45..6b02d1c 100644
--- a/dnsu2t.c
+++ b/dnsu2t.c
@@ -336,10 +336,10 @@ static int dnsu2t_onenter(parser_section *section)

 	INIT_LIST_HEAD(&instance->list);
 	instance->config.bindaddr.sin_family = AF_INET;
