[PATCH v2 3/5] dnsproxy: Add command line switch

Daniel Wagner wagi at monom.org
Tue Jan 25 04:26:04 PST 2011


From: Daniel Wagner <daniel.wagner at bmw-carit.de>

Command line switch to disable dnsproxy.
---
 src/main.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index a38eb60..8eaab16 100644
--- a/src/main.c
+++ b/src/main.c
@@ -63,6 +63,7 @@ static gchar *option_nodevice = NULL;
 static gchar *option_noplugin = NULL;
 static gchar *option_wifi = NULL;
 static gboolean option_detach = TRUE;
+static gboolean option_dnsproxy = TRUE;
 static gboolean option_compat = FALSE;
 static gboolean option_version = FALSE;
 
@@ -94,6 +95,9 @@ static GOptionEntry options[] = {
 	{ "nodaemon", 'n', G_OPTION_FLAG_REVERSE,
 				G_OPTION_ARG_NONE, &option_detach,
 				"Don't fork daemon to background" },
+	{ "nodsnproxy", 'x', G_OPTION_FLAG_REVERSE,
+				G_OPTION_ARG_NONE, &option_dnsproxy,
+				"Don't enable dnsproxy" },
 	{ "compat", 'c', 0, G_OPTION_ARG_NONE, &option_compat,
 				"Enable Network Manager compatibility" },
 	{ "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
@@ -224,7 +228,8 @@ int main(int argc, char *argv[])
 	__connman_config_init();
 	__connman_stats_init();
 
-	__connman_dnsproxy_init();
+	if (option_dnsproxy == TRUE)
+		__connman_dnsproxy_init();
 	__connman_resolver_init();
 	__connman_ipconfig_init();
 	__connman_rtnl_init();
@@ -262,7 +267,8 @@ int main(int argc, char *argv[])
 	__connman_rtnl_cleanup();
 	__connman_ipconfig_cleanup();
 	__connman_resolver_cleanup();
-	__connman_dnsproxy_cleanup();
+	if (option_dnsproxy == TRUE)
+		__connman_dnsproxy_cleanup();
 
 	__connman_stats_cleanup();
 	__connman_config_cleanup();
-- 
1.7.3.4




More information about the connman mailing list