}
rc->use_cert = 1;
} else {
+ struct config_strlist* p;
rc->ctx = NULL;
rc->use_cert = 0;
+ for(p = cfg->control_ifs.first; p; p = p->next) {
+ if(p->str && p->str[0] != '/')
+ log_warn("control-interface %s is not using TLS, but plain transfer, because first control-interface in config file is a local socket (starts with a /).", p->str);
+ }
}
return rc;
}
{
struct listen_port* l = NULL;
log_assert(cfg->remote_control_enable && cfg->control_port);
- if(cfg->control_ifs) {
+ if(cfg->control_ifs.first) {
struct config_strlist* p;
- for(p = cfg->control_ifs; p; p = p->next) {
+ for(p = cfg->control_ifs.first; p; p = p->next) {
if(!add_open(p->str, cfg->control_port, &l, 1, cfg)) {
listening_ports_free(l);
return NULL;
cfg->insecure_lan_zones = 0;
cfg->python_script = NULL;
cfg->remote_control_enable = 0;
- cfg->control_ifs = NULL;
+ cfg->control_ifs.first = NULL;
+ cfg->control_ifs.last = NULL;
cfg->control_port = UNBOUND_CONTROL_PORT;
cfg->minimal_responses = 0;
cfg->rrset_roundrobin = 0;
#define S_STRLIST_UNIQ(str, var) if(strcmp(opt, str)==0) \
{ if(cfg_strlist_find(cfg->var, val)) { return 0;} \
return cfg_strlist_insert(&cfg->var, strdup(val)); }
+/** append string to strlist */
+#define S_STRLIST_APPEND(str, var) if(strcmp(opt, str)==0) \
+ { return cfg_strlist_append(&cfg->var, strdup(val)); }
int config_set_option(struct config_file* cfg, const char* opt,
const char* val)
else S_YNO("unblock-lan-zones:", unblock_lan_zones)
else S_YNO("insecure-lan-zones:", insecure_lan_zones)
else S_YNO("control-enable:", remote_control_enable)
- else S_STRLIST("control-interface:", control_ifs)
+ else S_STRLIST_APPEND("control-interface:", control_ifs)
else S_NUMBER_NONZERO("control-port:", control_port)
else S_STR("server-key-file:", server_key_file)
else S_STR("server-cert-file:", server_cert_file)
else O_YNO(opt, "trust-anchor-signaling", trust_anchor_signaling)
else O_YNO(opt, "root-key-sentinel", root_key_sentinel)
else O_LST(opt, "dlv-anchor", dlv_anchor_list)
- else O_LST(opt, "control-interface", control_ifs)
+ else O_LST(opt, "control-interface", control_ifs.first)
else O_LST(opt, "domain-insecure", domain_insecure)
else O_UNS(opt, "val-override-date", val_date_override)
else O_YNO(opt, "minimal-responses", minimal_responses)
config_del_strbytelist(cfg->respip_tags);
config_deltrplstrlist(cfg->acl_tag_actions);
config_deltrplstrlist(cfg->acl_tag_datas);
- config_delstrlist(cfg->control_ifs);
+ config_delstrlist(cfg->control_ifs.first);
free(cfg->server_key_file);
free(cfg->server_cert_file);
free(cfg->control_key_file);
int options_remote_is_address(struct config_file* cfg)
{
if(!cfg->remote_control_enable) return 0;
- if(!cfg->control_ifs) return 1;
- if(!cfg->control_ifs->str) return 1;
- if(cfg->control_ifs->str[0] == 0) return 1;
- return (cfg->control_ifs->str[0] != '/');
+ if(!cfg->control_ifs.first) return 1;
+ if(!cfg->control_ifs.first->str) return 1;
+ if(cfg->control_ifs.first->str[0] == 0) return 1;
+ return (cfg->control_ifs.first->str[0] != '/');
}
struct ub_packed_rrset_key;
struct regional;
+/** List head for strlist processing, used for append operation. */
+struct config_strlist_head {
+ /** first in list of text items */
+ struct config_strlist* first;
+ /** last in list of text items */
+ struct config_strlist* last;
+};
+
/**
* The configuration options.
* Strings are malloced.
/** remote control section. enable toggle. */
int remote_control_enable;
/** the interfaces the remote control should listen on */
- struct config_strlist* control_ifs;
+ struct config_strlist_head control_ifs;
/** port number for the control port */
int control_port;
/** private key file for server */
size_t str2len;
};
-/** List head for strlist processing, used for append operation. */
-struct config_strlist_head {
- /** first in list of text items */
- struct config_strlist* first;
- /** last in list of text items */
- struct config_strlist* last;
-};
-
/**
* Create config file structure. Filled with default values.
* @return: the new structure or NULL on memory error.