mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 09:58:01 +00:00
dns-resolve: Allow unbound's config file to be set through an env var.
When an unbound context is created, check whether OVS_UNBOUND_CONF has been set. If a valid config file is supplied then use it to configure the context. The procedure returns if the config file is invalid. If no config file is found then the default unbound config is used. Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ted Elhourani <ted.elhourani@nutanix.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
parent
b0672f4ba2
commit
f00c47b8f3
@ -97,7 +97,9 @@ need the following software:
|
|||||||
specifying OpenFlow and OVSDB remotes. If unbound library is already
|
specifying OpenFlow and OVSDB remotes. If unbound library is already
|
||||||
installed, then Open vSwitch will automatically build with support for it.
|
installed, then Open vSwitch will automatically build with support for it.
|
||||||
The environment variable OVS_RESOLV_CONF can be used to specify DNS server
|
The environment variable OVS_RESOLV_CONF can be used to specify DNS server
|
||||||
configuration file (the default file on Linux is /etc/resolv.conf).
|
configuration file (the default file on Linux is /etc/resolv.conf), and
|
||||||
|
environment variable OVS_UNBOUND_CONF can be used to specify the
|
||||||
|
configuration file for unbound.
|
||||||
|
|
||||||
On Linux, you may choose to compile the kernel module that comes with the Open
|
On Linux, you may choose to compile the kernel module that comes with the Open
|
||||||
vSwitch distribution or to use the kernel module built into the Linux kernel
|
vSwitch distribution or to use the kernel module built into the Linux kernel
|
||||||
|
2
NEWS
2
NEWS
@ -5,6 +5,8 @@ Post-v2.14.0
|
|||||||
status of the storage that's backing a database.
|
status of the storage that's backing a database.
|
||||||
- DPDK:
|
- DPDK:
|
||||||
* Removed support for vhost-user dequeue zero-copy.
|
* Removed support for vhost-user dequeue zero-copy.
|
||||||
|
- The environment variable OVS_UNBOUND_CONF, if set, is now used
|
||||||
|
as the DNS resolver's (unbound) configuration file.
|
||||||
|
|
||||||
|
|
||||||
v2.14.0 - 17 Aug 2020
|
v2.14.0 - 17 Aug 2020
|
||||||
|
@ -82,6 +82,18 @@ dns_resolve_init(bool is_daemon)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *ub_conf_filename = getenv("OVS_UNBOUND_CONF");
|
||||||
|
if (ub_conf_filename != NULL) {
|
||||||
|
int retval = ub_ctx_config(ub_ctx__, ub_conf_filename);
|
||||||
|
if (retval != 0) {
|
||||||
|
VLOG_WARN_RL(&rl, "Failed to set libunbound context config: %s",
|
||||||
|
ub_strerror(retval));
|
||||||
|
ub_ctx_delete(ub_ctx__);
|
||||||
|
ub_ctx__ = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const char *filename = getenv("OVS_RESOLV_CONF");
|
const char *filename = getenv("OVS_RESOLV_CONF");
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user