- Patch for view functionality for local-data-ptr from Björn Ketelaars.

git-svn-id: file:///svn/unbound/trunk@4063 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2017-03-17 08:01:40 +00:00
parent 984c6c33bc
commit 52dd15dd87
5 changed files with 621 additions and 578 deletions

View file

@ -1,3 +1,6 @@
17 March 2017: Wouter
- Patch for view functionality for local-data-ptr from Björn Ketelaars.
16 March 2017: Wouter 16 March 2017: Wouter
- Fix that SHM is not inited if not enabled. - Fix that SHM is not inited if not enabled.
- Add trustanchor.unbound CH TXT that gets a response with a number - Add trustanchor.unbound CH TXT that gets a response with a number

View file

@ -782,6 +782,7 @@ remote-control:
# name: "viewname" # name: "viewname"
# local-zone: "example.com" redirect # local-zone: "example.com" redirect
# local-data: "example.com A 192.0.2.3" # local-data: "example.com A 192.0.2.3"
# local-data-ptr: "192.0.2.3 www.example.com"
# view-first: no # view-first: no
# view: # view:
# name: "anotherview" # name: "anotherview"

View file

@ -1406,6 +1406,10 @@ global local\-zone elements.
View specific local\-data elements. Has the same behaviour as the global View specific local\-data elements. Has the same behaviour as the global
local\-data elements. local\-data elements.
.TP .TP
.B local\-data\-ptr: \fI"IPaddr name"
View specific local\-data\-ptr elements. Has the same behaviour as the global
local\-data\-ptr elements.
.TP
.B view\-first: \fI<yes or no> .B view\-first: \fI<yes or no>
If enabled, it attempts to use the global local\-zone and local\-data if there If enabled, it attempts to use the global local\-zone and local\-data if there
is no match in the view specific options. is no match in the view specific options.

File diff suppressed because it is too large Load diff

View file

@ -272,7 +272,7 @@ viewstart: VAR_VIEW
contents_view: contents_view content_view contents_view: contents_view content_view
| ; | ;
content_view: view_name | view_local_zone | view_local_data | view_first | content_view: view_name | view_local_zone | view_local_data | view_first |
view_response_ip | view_response_ip_data view_response_ip | view_response_ip_data | view_local_data_ptr
; ;
server_num_threads: VAR_NUM_THREADS STRING_ARG server_num_threads: VAR_NUM_THREADS STRING_ARG
{ {
@ -1864,6 +1864,21 @@ view_local_data: VAR_LOCAL_DATA STRING_ARG
} }
} }
; ;
view_local_data_ptr: VAR_LOCAL_DATA_PTR STRING_ARG
{
char* ptr;
OUTYY(("P(view_local_data_ptr:%s)\n", $2));
ptr = cfg_ptr_reverse($2);
free($2);
if(ptr) {
if(!cfg_strlist_insert(&cfg_parser->cfg->views->
local_data, ptr))
fatal_exit("out of memory adding local-data");
} else {
yyerror("local-data-ptr could not be reversed");
}
}
;
view_first: VAR_VIEW_FIRST STRING_ARG view_first: VAR_VIEW_FIRST STRING_ARG
{ {
OUTYY(("P(view-first:%s)\n", $2)); OUTYY(("P(view-first:%s)\n", $2));