diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-01-27 15:31:36 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-01-31 15:58:36 +0100 |
commit | cde0b261b8976d168af0cfa05f68f0d2543c501e (patch) | |
tree | 1afa8c5e7786fd0e8901609e4b72d72c2cf1a120 /src/resolver.c | |
parent | 268f4a8f7e81d8b32591e01b6dbcdca0bee1322f (diff) | |
download | connman-cde0b261b8976d168af0cfa05f68f0d2543c501e.tar.gz connman-cde0b261b8976d168af0cfa05f68f0d2543c501e.tar.bz2 connman-cde0b261b8976d168af0cfa05f68f0d2543c501e.zip |
dnsproxy: Fallback to resolv.conf if dnsproxy fails
In case dnsproxy can't create the socket listener we
should fall back to resolv.conf.
Reported by Kalle Valo <kalle.valo@canonical.com>
Diffstat (limited to 'src/resolver.c')
-rw-r--r-- | src/resolver.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/resolver.c b/src/resolver.c index 42be0304..73175b30 100644 --- a/src/resolver.c +++ b/src/resolver.c @@ -447,11 +447,23 @@ int __connman_resolver_init(connman_bool_t dnsproxy) { DBG("dnsproxy %d", dnsproxy); - dnsproxy_enabled = dnsproxy; + if (dnsproxy == FALSE) + return 0; + + if (__connman_dnsproxy_init() < 0) { + /* Fall back to resolv.conf */ + return 0; + } + + dnsproxy_enabled = TRUE; + return 0; } void __connman_resolver_cleanup(void) { DBG(""); + + if (dnsproxy_enabled == TRUE) + __connman_dnsproxy_cleanup(); } |