summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/resolver.h3
-rw-r--r--src/resolver.c21
-rw-r--r--src/service.c2
3 files changed, 26 insertions, 0 deletions
diff --git a/include/resolver.h b/include/resolver.h
index 3b274c9f..ae77039e 100644
--- a/include/resolver.h
+++ b/include/resolver.h
@@ -41,6 +41,8 @@ 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);
+
#define CONNMAN_RESOLVER_PRIORITY_LOW -100
#define CONNMAN_RESOLVER_PRIORITY_DEFAULT 0
#define CONNMAN_RESOLVER_PRIORITY_HIGH 100
@@ -52,6 +54,7 @@ struct connman_resolver {
const char *server);
int (*remove) (const char *interface, const char *domain,
const char *server);
+ void (*flush) (void);
};
int connman_resolver_register(struct connman_resolver *resolver);
diff --git a/src/resolver.c b/src/resolver.c
index 5caf7a85..f3faacdf 100644
--- a/src/resolver.c
+++ b/src/resolver.c
@@ -291,6 +291,27 @@ int connman_resolver_remove_public_server(const char *server)
return connman_resolver_remove(NULL, NULL, server);
}
+/**
+ * connman_resolver_flush:
+ *
+ * Flush pending resolver requests
+ */
+void connman_resolver_flush(void)
+{
+ GSList *list;
+
+ for (list = resolver_list; list; list = list->next) {
+ struct connman_resolver *resolver = list->data;
+
+ if (resolver->flush == NULL)
+ continue;
+
+ resolver->flush();
+ }
+
+ return;
+}
+
static int selftest_append(const char *interface, const char *domain,
const char *server)
{
diff --git a/src/service.c b/src/service.c
index d1309587..038d1a08 100644
--- a/src/service.c
+++ b/src/service.c
@@ -340,6 +340,8 @@ static void update_nameservers(struct connman_service *service)
service->nameservers[i]);
} else if (service->nameserver != NULL)
connman_resolver_append(ifname, NULL, service->nameserver);
+
+ connman_resolver_flush();
}
void __connman_service_append_nameserver(struct connman_service *service,