From 6a0f8d2a7086c31f73987fc473d17538d44fb9ca Mon Sep 17 00:00:00 2001 From: David McFarland Date: Tue, 9 Nov 2021 20:48:19 -0400 Subject: [PATCH] resolve: add option to specify resolvconf search domain --- src/libcharon/plugins/resolve/resolve_handler.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libcharon/plugins/resolve/resolve_handler.c b/src/libcharon/plugins/resolve/resolve_handler.c index c2f3dca93e..893d389c87 100644 --- a/src/libcharon/plugins/resolve/resolve_handler.c +++ b/src/libcharon/plugins/resolve/resolve_handler.c @@ -61,6 +61,8 @@ struct private_resolve_handler_t { */ char *iface_prefix; + char *search_domain; + /** * Mutex to access file exclusively */ @@ -211,6 +213,8 @@ static bool invoke_resolvconf(private_resolve_handler_t *this, host_t *addr, if (shell) { DBG1(DBG_IKE, "installing DNS server %H via resolvconf", addr); + if (this->search_domain) + fprintf(shell, "search %s\n", this->search_domain); fprintf(shell, "nameserver %H\n", addr); fclose(shell); } @@ -499,6 +503,9 @@ resolve_handler_t *resolve_handler_create() this->iface_prefix = lib->settings->get_str(lib->settings, "%s.plugins.resolve.resolvconf.iface_prefix", RESOLVCONF_PREFIX, lib->ns); + this->search_domain = lib->settings->get_str(lib->settings, + "%s.plugins.resolve.resolvconf.search_domain", + NULL, lib->ns); } return &this->public;