+31 May 2017: Ralph
+ - Also use global local-zones when there is a matching view that does
+ not have any local-zone specified.
+
31 May 2017: Wouter
- Fix #1273: cachedb.c doesn't compile with -Wextra.
- If MSG_FASTOPEN gives EPIPE fallthrough to try normal tcp write.
\fBlocal\-data\fR elements. View can be mapped to requests by specifying the
view name in an \fBaccess\-control\-view\fR element. Options from matching
views will override global options. Global options will be used if no matching
-view is found.
+view is found, or when the matching view does not have the option specified.
.TP
.B name: \fI<view name>
Name of the view. Must be unique. This name is used in access\-control\-view
.TP
.B local\-zone: \fI<zone> <type>
View specific local\-zone elements. Has the same types and behaviour as the
-global local\-zone elements.
+global local\-zone elements. When there is at least one local\-zone specified
+and view\-first is no, the default local-zones will be added to this view.
+Defaults can be disabled using the nodefault type. When view\-first is yes or
+when a view does not have a local\-zone, the global local\-zone will be used
+including it's default zones.
.TP
.B local\-data: \fI"<resource record string>"
View specific local\-data elements. Has the same behaviour as the global
lock_rw_rdlock(&z->lock);
lzt = z->type;
}
- if(!z && !view->isfirst){
+ if(view->local_zones && !z && !view->isfirst){
lock_rw_unlock(&view->lock);
return 0;
}
* configured as type transparent */
for(nd = cv->local_zones_nodefault; nd;
nd = nd->next) {
- cfg_str2list_insert(&lz_cfg.local_zones,
- strdup(nd->str),
- strdup("nodefault"));
+ char* nd_str, *nd_type;
+ nd_str = strdup(nd->str);
+ if(!nd_str) {
+ log_err("out of memory");
+ lock_rw_unlock(&v->lock);
+ return 0;
+ }
+ nd_type = strdup("nodefault");
+ if(!nd_type) {
+ log_err("out of memory");
+ free(nd_str);
+ lock_rw_unlock(&v->lock);
+ return 0;
+ }
+ if(!cfg_str2list_insert(
+ &lz_cfg.local_zones, nd_str,
+ nd_type)) {
+ log_err("failed to insert "
+ "default zones into "
+ "local-zone list");
+ free(nd_str);
+ free(nd_type);
+ lock_rw_unlock(&v->lock);
+ return 0;
+ }
}
}
if(!local_zones_apply_cfg(v->local_zones, &lz_cfg)){