Commit 7fbd9b76 authored by Evan Hunt's avatar Evan Hunt

make named-checkconf able to check dns64 module parameters

- restored the checkconf test cases from the dns64 system test
- implemented plugin_check() in the dns64 module
parent c8f36b44
Pipeline #20603 failed with stages
in 3 minutes and 12 seconds
......@@ -412,7 +412,7 @@ cleanup:
}
static isc_result_t
check_syntax(cfg_obj_t *dmap, const cfg_obj_t *cfg,
check_syntax(cfg_obj_t *dmap, const void *cfg,
isc_mem_t *mctx, isc_log_t *lctx, void *actx)
{
isc_result_t result = ISC_R_SUCCESS;
......@@ -537,8 +537,7 @@ parse_parameters(dns64_instance_t *inst, const char *parameters,
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, (const cfg_obj_t *) cfg,
mctx, lctx, actx));
CHECK(check_syntax(param_obj, cfg, mctx, lctx, actx));
CHECK(cfg_map_get(param_obj, "dns64", &dns64_obj));
......@@ -1106,15 +1105,28 @@ plugin_check(const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, isc_log_t *lctx, void *actx)
{
UNUSED(parameters);
UNUSED(cfg_file);
UNUSED(cfg_line);
UNUSED(cfg);
UNUSED(mctx);
UNUSED(lctx);
UNUSED(actx);
isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL;
isc_buffer_t b;
return (ISC_R_SUCCESS);
CHECK(cfg_parser_create(mctx, lctx, &parser));
isc_buffer_constinit(&b, parameters, strlen(parameters));
isc_buffer_add(&b, strlen(parameters));
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, lctx, actx));
cleanup:
if (param_obj != NULL) {
cfg_obj_destroy(parser, &param_obj);
}
if (parser != NULL) {
cfg_parser_destroy(&parser);
}
return (result);
}
/*
......
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 ::/0 { };
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 ::/96 { suffix ::1; };
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 ::/96 { suffix 127.0.0.1; };
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 ::/129 { };
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 ::/129 { };
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 :: { };
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 FC36:EAFE:F993::/64 {
exclude { bogusacl; };
};
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 FC36:EAFE:F993::/64 {
clients { bogusacl; };
};
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
plugin query "../../../plugins/lib/dns64.so" {
dns64 FC36:EAFE:F993::/64 {
mapped { bogusacl; };
};
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
plugin query "../../../plugins/lib/dns64.so" {
/* Well Known Prefix */
dns64 64:FF9B::/96 {
clients { any; };
mapped { !rfc1918; any; };
exclude { ::ffff:0:0/96; };
};
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
plugin query "../../../plugins/lib/dns64.so" {
/* Well Known Prefix */
dns64 64:FF9B::/96 {
mapped { !rfc1918; any; };
exclude { ::ffff:0:0/96; };
};
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
plugin query "../../../plugins/lib/dns64.so" {
/* Well Known Prefix */
dns64 64:FF9B::/96 {
clients { any; };
exclude { ::ffff:0:0/96; };
};
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
plugin query "../../../plugins/lib/dns64.so" {
/* Well Known Prefix */
dns64 64:FF9B::/96 {
clients { any; };
mapped { !rfc1918; any; };
};
};
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
plugin query "../../../plugins/lib/dns64.so" {
/* Well Known Prefix */
dns64 64:FF9B::/96 { };
};
......@@ -19,6 +19,26 @@ rm -f dig.out.*
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p ${PORT}"
for conf in conf/good*.conf
do
n=`expr $n + 1`
echo_i "checking that $conf is accepted ($n)"
ret=0
$CHECKCONF "$conf" || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
done
for conf in conf/bad*.conf
do
n=`expr $n + 1`
echo_i "checking that $conf is rejected ($n)"
ret=0
$CHECKCONF "$conf" >/dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
done
# Check the example. domain
echo_i "checking non-excluded AAAA lookup works ($n)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment