oldlen = newlen; \
}
+static const char *remotesnames[4] = { "remote-servers", "parental-agents",
+ "primaries", "masters" };
+
isc_result_t
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
isc_mem_t *mctx, dns_ipkeylist_t *ipkl) {
continue;
}
list = NULL;
- tresult = named_config_getremotesdef(
- config, "remote-servers", listname, &list);
+ tresult = ISC_R_NOTFOUND;
+ for (size_t n = 0; n < ARRAY_SIZE(remotesnames); n++) {
+ tresult = named_config_getremotesdef(
+ config, remotesnames[n], listname,
+ &list);
+ if (tresult == ISC_R_SUCCESS) {
+ break;
+ }
+ }
if (tresult == ISC_R_NOTFOUND) {
cfg_obj_log(addr, ISC_LOG_ERROR,
"remote-servers \"%s\" not found",
listname);
-
- result = tresult;
- goto cleanup;
}
if (tresult != ISC_R_SUCCESS) {
+ result = tresult;
goto cleanup;
}
lists[l++].name = listname;
--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+remote-servers duplicate { 1.2.3.4; };
+primaries duplicate { 4.3.2.1; };
--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+remote-servers "one" {
+ 1.2.3.4;
+};
+
+parental-agents "two" {
+ 1.2.3.5;
+};
+
+primaries "three" {
+ 1.2.3.6;
+};
+
+masters "four" {
+ 1.2.3.7;
+};
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
+ /* parental-agents, primaries, masters are treated as synonyms */
+ tresult = check_remoteserverlist(cctx, "parental-agents", symtab, mctx);
+ if (tresult != ISC_R_SUCCESS) {
+ result = tresult;
+ }
+ tresult = check_remoteserverlist(cctx, "primaries", symtab, mctx);
+ if (tresult != ISC_R_SUCCESS) {
+ result = tresult;
+ }
+ tresult = check_remoteserverlist(cctx, "masters", symtab, mctx);
+ if (tresult != ISC_R_SUCCESS) {
+ result = tresult;
+ }
isc_symtab_destroy(&symtab);
return result;
}
}
static isc_result_t
-get_remoteservers_def(const char *list, const char *name, const cfg_obj_t *cctx,
- const cfg_obj_t **ret) {
+get_remotes(const cfg_obj_t *cctx, const char *list, const char *name,
+ const cfg_obj_t **ret) {
isc_result_t result;
const cfg_obj_t *obj = NULL;
const cfg_listelt_t *elt = NULL;
return ISC_R_NOTFOUND;
}
+static isc_result_t
+get_remoteservers_def(const char *name, const cfg_obj_t *cctx,
+ const cfg_obj_t **ret) {
+ isc_result_t result;
+
+ result = get_remotes(cctx, "remote-servers", name, ret);
+ if (result == ISC_R_SUCCESS) {
+ return result;
+ }
+ result = get_remotes(cctx, "primaries", name, ret);
+ if (result == ISC_R_SUCCESS) {
+ return result;
+ }
+ result = get_remotes(cctx, "parental-agents", name, ret);
+ if (result == ISC_R_SUCCESS) {
+ return result;
+ }
+ return get_remotes(cctx, "masters", name, ret);
+}
+
static isc_result_t
validate_remotes(const cfg_obj_t *obj, const cfg_obj_t *config,
uint32_t *countp, isc_mem_t *mctx) {
if (tresult == ISC_R_EXISTS) {
continue;
}
- tresult = get_remoteservers_def("remote-servers", listname,
- config, &obj);
+ tresult = get_remoteservers_def(listname, config, &obj);
if (tresult != ISC_R_SUCCESS) {
if (result == ISC_R_SUCCESS) {
result = tresult;
{ "masters", &cfg_type_remoteservers,
CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC },
{ "options", &cfg_type_options, 0 },
+ { "parental-agents", &cfg_type_remoteservers,
+ CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC },
+ { "primaries", &cfg_type_remoteservers,
+ CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC },
{ "remote-servers", &cfg_type_remoteservers, CFG_CLAUSEFLAG_MULTI },
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON_C)
{ "statistics-channels", &cfg_type_statschannels,