From 6e45059d17b5e0a1c60edd8187b47a1ae6941a9e Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 23 Feb 2011 19:15:07 +0100 Subject: [PATCH] service: Add a nameserver clearing routine --- src/connman.h | 1 + src/service.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/connman.h b/src/connman.h index 4e0d3fc..842e424 100644 --- a/src/connman.h +++ b/src/connman.h @@ -514,6 +514,7 @@ int __connman_service_nameserver_append(struct connman_service *service, const char *nameserver); int __connman_service_nameserver_remove(struct connman_service *service, const char *nameserver); +void __connman_service_nameserver_clear(struct connman_service *service); void __connman_service_nameserver_add_routes(struct connman_service *service, const char *gw); void __connman_service_nameserver_del_routes(struct connman_service *service); diff --git a/src/service.c b/src/service.c index 38111ee..6ff90e7 100644 --- a/src/service.c +++ b/src/service.c @@ -619,6 +619,14 @@ int __connman_service_nameserver_remove(struct connman_service *service, return 0; } +void __connman_service_nameserver_clear(struct connman_service *service) +{ + g_strfreev(service->nameservers); + service->nameservers = NULL; + + update_nameservers(service); +} + static void nameserver_add_routes(int index, char **nameservers, const char *gw) { -- 2.7.4