* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: config.c,v 1.24 2002/01/04 02:32:00 gson Exp $ */
+/* $Id: config.c,v 1.25 2002/01/14 04:16:00 marka Exp $ */
#include <config.h>
isc_result_t result;
INSIST(addrsp != NULL && *addrsp == NULL);
+ INSIST(countp != NULL && *addrsp == 0);
addrlist = cfg_tuple_get(list, "addresses");
count = ns_config_listcount(addrlist);
+ if (count == 0)
+ return (ISC_R_SUCCESS);
+
portobj = cfg_tuple_get(list, "port");
if (cfg_obj_isuint32(portobj)) {
isc_uint32_t val = cfg_obj_asuint32(portobj);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zoneconf.c,v 1.97 2001/11/30 01:58:52 gson Exp $ */
+/* $Id: zoneconf.c,v 1.98 2002/01/14 04:16:01 marka Exp $ */
#include <config.h>
result = ns_config_get(maps, "also-notify", &obj);
if (result == ISC_R_SUCCESS) {
isc_sockaddr_t *addrs = NULL;
- isc_uint32_t addrcount;
+ isc_uint32_t addrcount = 0;
result = ns_config_getiplist(config, obj, 0, mctx,
&addrs, &addrcount);
if (result != ISC_R_SUCCESS)
return (result);
result = dns_zone_setalsonotify(zone, addrs,
addrcount);
- ns_config_putiplist(mctx, &addrs, addrcount);
+ if (addrs != NULL)
+ ns_config_putiplist(mctx, &addrs, addrcount);
if (result != ISC_R_SUCCESS)
return (result);
} else
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: check.c,v 1.13 2001/12/29 04:49:51 marka Exp $ */
+/* $Id: check.c,v 1.14 2002/01/14 04:15:58 marka Exp $ */
#include <config.h>
} intervaltable;
static isc_result_t
-check_options(cfg_obj_t *options, isc_log_t *logctx) {
+check_options(cfg_obj_t *options, isc_log_t *logctx, isc_boolean_t toplevel) {
isc_result_t result = ISC_R_SUCCESS;
unsigned int i;
cfg_obj_t *obj = NULL;
(void)cfg_map_get(options, "also-notify", &obj);
if (obj != NULL) {
cfg_obj_t *addrlist = NULL;
+ cfg_obj_t *port = NULL;
addrlist = cfg_tuple_get(obj, "addresses");
+ port = cfg_tuple_get(obj, "port");
if (cfg_list_first(addrlist) == NULL) {
- cfg_obj_log(options, logctx, ISC_LOG_ERROR,
- "empty 'also-notify' entry");
- if (result == ISC_R_SUCCESS)
- result = ISC_R_FAILURE;
+ if (toplevel) {
+ cfg_obj_log(options, logctx, ISC_LOG_ERROR,
+ "empty 'also-notify' entry");
+ if (result == ISC_R_SUCCESS)
+ result = ISC_R_FAILURE;
+ } else if (cfg_obj_isuint32(port)) {
+ cfg_obj_log(options, logctx, ISC_LOG_ERROR,
+ "port specified with "
+ "empty 'also-notify'");
+ if (result == ISC_R_SUCCESS)
+ result = ISC_R_FAILURE;
+ }
}
}
return (result);
/*
* Check various options.
*/
- tresult = check_options(zoptions, logctx);
+ tresult = check_options(zoptions, logctx, ISC_FALSE);
if (tresult != ISC_R_SUCCESS)
result = tresult;
}
if (vconfig != NULL)
- tresult = check_options(vconfig, logctx);
+ tresult = check_options(vconfig, logctx, ISC_FALSE);
else
- tresult = check_options(config, logctx);
+ tresult = check_options(config, logctx, ISC_TRUE);
if (tresult != ISC_R_SUCCESS)
result = tresult;
(void)cfg_map_get(config, "options", &options);
if (options != NULL &&
- check_options(options, logctx) != ISC_R_SUCCESS)
+ check_options(options, logctx, ISC_TRUE) != ISC_R_SUCCESS)
result = ISC_R_FAILURE;
(void)cfg_map_get(config, "view", &views);