Skip to content

Commit

Permalink
resolve: add option to specify resolvconf search domain
Browse files Browse the repository at this point in the history
  • Loading branch information
corngood committed Nov 11, 2022
1 parent 91e90cd commit 6a0f8d2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libcharon/plugins/resolve/resolve_handler.c
Expand Up @@ -61,6 +61,8 @@ struct private_resolve_handler_t {
*/
char *iface_prefix;

char *search_domain;

/**
* Mutex to access file exclusively
*/
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6a0f8d2

Please sign in to comment.