mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
2353. [func] Add support for Name Server ID (RFC 5001).
'dig +nsid' requests NSID from server. 'request-nsid yes;' causes recursive server to send NSID requests to upstream servers. Server responds to NSID requests with the string configured by 'server-id' option. [RT #17091]
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: server.c,v 1.503 2008/03/31 05:00:29 marka Exp $ */
|
||||
/* $Id: server.c,v 1.504 2008/04/03 02:01:08 marka Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@@ -729,6 +729,11 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
|
||||
if (obj != NULL)
|
||||
CHECK(dns_peer_setrequestixfr(peer, cfg_obj_asboolean(obj)));
|
||||
|
||||
obj = NULL;
|
||||
(void)cfg_map_get(cpeer, "request-nsid", &obj);
|
||||
if (obj != NULL)
|
||||
CHECK(dns_peer_setrequestnsid(peer, cfg_obj_asboolean(obj)));
|
||||
|
||||
obj = NULL;
|
||||
(void)cfg_map_get(cpeer, "edns", &obj);
|
||||
if (obj != NULL)
|
||||
@@ -1656,6 +1661,11 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
view->provideixfr = cfg_obj_asboolean(obj);
|
||||
|
||||
obj = NULL;
|
||||
result = ns_config_get(maps, "request-nsid", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
view->requestnsid = cfg_obj_asboolean(obj);
|
||||
|
||||
obj = NULL;
|
||||
result = ns_config_get(maps, "max-clients-per-query", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
@@ -3465,8 +3475,12 @@ load_configuration(const char *filename, ns_server_t *server,
|
||||
result = ns_config_get(maps, "server-id", &obj);
|
||||
server->server_usehostname = ISC_FALSE;
|
||||
if (result == ISC_R_SUCCESS && cfg_obj_isboolean(obj)) {
|
||||
server->server_usehostname = ISC_TRUE;
|
||||
/* The parser translates "hostname" to ISC_TRUE */
|
||||
server->server_usehostname = cfg_obj_asboolean(obj);
|
||||
result = setstring(server, &server->server_id, NULL);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
} else if (result == ISC_R_SUCCESS) {
|
||||
/* Found a quoted string */
|
||||
CHECKM(setoptstring(server, &server->server_id, obj), "strdup");
|
||||
} else {
|
||||
result = setstring(server, &server->server_id, NULL);
|
||||
|
Reference in New Issue
Block a user