From: Patrik Flykt Date: Wed, 11 Apr 2012 13:29:02 +0000 (+0300) Subject: resolver: Append fallback nameservers X-Git-Tag: 0.80~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7212a3e398a7f51067068e48749a662a1c052f1;p=platform%2Fupstream%2Fconnman.git resolver: Append fallback nameservers Append fallback nameservers, if any. Remove functions for adding removing public nameservers since they are not used anymore. --- diff --git a/include/resolver.h b/include/resolver.h index c7c6b53..0ada1b1 100644 --- a/include/resolver.h +++ b/include/resolver.h @@ -40,9 +40,6 @@ int connman_resolver_remove(const char *interface, const char *domain, const char *server); int connman_resolver_remove_all(const char *interface); -int connman_resolver_append_public_server(const char *server); -int connman_resolver_remove_public_server(const char *server); - void connman_resolver_flush(void); #ifdef __cplusplus diff --git a/src/resolver.c b/src/resolver.c index 53ccf90..9796717 100644 --- a/src/resolver.c +++ b/src/resolver.c @@ -456,32 +456,6 @@ int connman_resolver_remove_all(const char *interface) } /** - * connman_resolver_append_public_server: - * @server: server address - * - * Append public resolver server address to current list - */ -int connman_resolver_append_public_server(const char *server) -{ - DBG("server %s", server); - - return append_resolver(NULL, NULL, server, 0, RESOLVER_FLAG_PUBLIC); -} - -/** - * connman_resolver_remove_public_server: - * @server: server address - * - * Remove public resolver server address to current list - */ -int connman_resolver_remove_public_server(const char *server) -{ - DBG("server %s", server); - - return connman_resolver_remove(NULL, NULL, server); -} - -/** * connman_resolver_flush: * * Flush pending resolver requests @@ -514,6 +488,9 @@ static void free_resolvfile(gpointer data) int __connman_resolver_init(connman_bool_t dnsproxy) { + int i; + char **ns; + DBG("dnsproxy %d", dnsproxy); if (dnsproxy == FALSE) @@ -526,6 +503,12 @@ int __connman_resolver_init(connman_bool_t dnsproxy) dnsproxy_enabled = TRUE; + ns = connman_setting_get_string_list("FallbackNameservers"); + for (i = 0; ns != NULL && ns[i] != NULL; i += 1) { + DBG("server %s", ns[i]); + append_resolver(NULL, NULL, ns[i], 0, RESOLVER_FLAG_PUBLIC); + } + return 0; }