mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch 'v9_12' of gitlab.isc.org:isc-projects/bind9 into v9_12
This commit is contained in:
commit
d636534ea8
2 changed files with 88 additions and 89 deletions
3
CHANGES
3
CHANGES
|
|
@ -2,6 +2,9 @@
|
|||
if available, to configure the test interfaces on
|
||||
linux. [GL #302]
|
||||
|
||||
4962. [cleanup] Move 'named -T' processing to its own function.
|
||||
[GL #316]
|
||||
|
||||
4958. [bug] Remove redundant space from NSEC3 record. [GL #281]
|
||||
|
||||
4955. [cleanup] Silence cppcheck warnings in lib/dns/master.c.
|
||||
|
|
|
|||
174
bin/named/main.c
174
bin/named/main.c
|
|
@ -466,6 +466,90 @@ parse_fuzz_arg(void) {
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
parse_T_opt(char *option) {
|
||||
const char *p;
|
||||
char *last = NULL;
|
||||
/*
|
||||
* force the server to behave (or misbehave) in
|
||||
* specified ways for testing purposes.
|
||||
*
|
||||
* clienttest: make clients single shot with their
|
||||
* own memory context.
|
||||
* delay=xxxx: delay client responses by xxxx ms to
|
||||
* simulate remote servers.
|
||||
* dscp=x: check that dscp values are as
|
||||
* expected and assert otherwise.
|
||||
*/
|
||||
if (!strcmp(option, "clienttest")) {
|
||||
clienttest = ISC_TRUE;
|
||||
} else if (!strncmp(option, "delay=", 6)) {
|
||||
delay = atoi(option + 6);
|
||||
} else if (!strcmp(option, "dropedns")) {
|
||||
dropedns = ISC_TRUE;
|
||||
} else if (!strncmp(option, "dscp=", 5)) {
|
||||
isc_dscp_check_value = atoi(option + 5);
|
||||
} else if (!strcmp(option, "fixedlocal")) {
|
||||
fixedlocal = ISC_TRUE;
|
||||
} else if (!strcmp(option, "keepstderr")) {
|
||||
named_g_keepstderr = ISC_TRUE;
|
||||
} else if (!strcmp(option, "noaa")) {
|
||||
noaa = ISC_TRUE;
|
||||
} else if (!strcmp(option, "noedns")) {
|
||||
noedns = ISC_TRUE;
|
||||
} else if (!strcmp(option, "nonearest")) {
|
||||
nonearest = ISC_TRUE;
|
||||
} else if (!strcmp(option, "nosoa")) {
|
||||
nosoa = ISC_TRUE;
|
||||
} else if (!strcmp(option, "nosyslog")) {
|
||||
named_g_nosyslog = ISC_TRUE;
|
||||
} else if (!strcmp(option, "notcp")) {
|
||||
notcp = ISC_TRUE;
|
||||
} else if (!strcmp(option, "maxudp512")) {
|
||||
maxudp = 512;
|
||||
} else if (!strcmp(option, "maxudp1460")) {
|
||||
maxudp = 1460;
|
||||
} else if (!strncmp(option, "maxudp=", 7)) {
|
||||
maxudp = atoi(option + 7);
|
||||
} else if (!strncmp(option, "mkeytimers=", 11)) {
|
||||
p = strtok_r(option + 11, "/", &last);
|
||||
if (p == NULL) {
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
}
|
||||
|
||||
dns_zone_mkey_hour = atoi(p);
|
||||
if (dns_zone_mkey_hour == 0) {
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
}
|
||||
|
||||
p = strtok_r(NULL, "/", &last);
|
||||
if (p == NULL) {
|
||||
dns_zone_mkey_day = (24 * dns_zone_mkey_hour);
|
||||
dns_zone_mkey_month = (30 * dns_zone_mkey_day);
|
||||
return;
|
||||
}
|
||||
|
||||
dns_zone_mkey_day = atoi(p);
|
||||
if (dns_zone_mkey_day < dns_zone_mkey_hour)
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
|
||||
p = strtok_r(NULL, "/", &last);
|
||||
if (p == NULL) {
|
||||
dns_zone_mkey_month = (30 * dns_zone_mkey_day);
|
||||
return;
|
||||
}
|
||||
|
||||
dns_zone_mkey_month = atoi(p);
|
||||
if (dns_zone_mkey_month < dns_zone_mkey_day) {
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
}
|
||||
} else if (!strncmp(option, "tat=", 4)) {
|
||||
named_g_tat_interval = atoi(option + 4);
|
||||
} else {
|
||||
fprintf(stderr, "unknown -T flag '%s\n", option);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
parse_command_line(int argc, char *argv[]) {
|
||||
int ch;
|
||||
|
|
@ -565,95 +649,7 @@ parse_command_line(int argc, char *argv[]) {
|
|||
named_g_chrootdir = isc_commandline_argument;
|
||||
break;
|
||||
case 'T': /* NOT DOCUMENTED */
|
||||
/*
|
||||
* force the server to behave (or misbehave) in
|
||||
* specified ways for testing purposes.
|
||||
*
|
||||
* clienttest: make clients single shot with their
|
||||
* own memory context.
|
||||
* delay=xxxx: delay client responses by xxxx ms to
|
||||
* simulate remote servers.
|
||||
* dscp=x: check that dscp values are as
|
||||
* expected and assert otherwise.
|
||||
*/
|
||||
if (!strcmp(isc_commandline_argument, "clienttest"))
|
||||
clienttest = ISC_TRUE;
|
||||
else if (!strcmp(isc_commandline_argument, "nosoa"))
|
||||
nosoa = ISC_TRUE;
|
||||
else if (!strcmp(isc_commandline_argument, "noaa"))
|
||||
noaa = ISC_TRUE;
|
||||
else if (!strcmp(isc_commandline_argument,
|
||||
"maxudp512"))
|
||||
maxudp = 512;
|
||||
else if (!strcmp(isc_commandline_argument,
|
||||
"maxudp1460"))
|
||||
maxudp = 1460;
|
||||
else if (!strcmp(isc_commandline_argument, "dropedns"))
|
||||
dropedns = ISC_TRUE;
|
||||
else if (!strcmp(isc_commandline_argument, "noedns"))
|
||||
noedns = ISC_TRUE;
|
||||
else if (!strncmp(isc_commandline_argument,
|
||||
"maxudp=", 7))
|
||||
maxudp = atoi(isc_commandline_argument + 7);
|
||||
else if (!strncmp(isc_commandline_argument,
|
||||
"delay=", 6))
|
||||
delay = atoi(isc_commandline_argument + 6);
|
||||
else if (!strcmp(isc_commandline_argument, "nosyslog"))
|
||||
named_g_nosyslog = ISC_TRUE;
|
||||
else if (!strcmp(isc_commandline_argument, "nonearest"))
|
||||
nonearest = ISC_TRUE;
|
||||
else if (!strncmp(isc_commandline_argument, "dscp=", 5))
|
||||
isc_dscp_check_value =
|
||||
atoi(isc_commandline_argument + 5);
|
||||
else if (!strncmp(isc_commandline_argument,
|
||||
"mkeytimers=", 11))
|
||||
{
|
||||
p = strtok(isc_commandline_argument + 11, "/");
|
||||
if (p == NULL)
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
dns_zone_mkey_hour = atoi(p);
|
||||
if (dns_zone_mkey_hour == 0)
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
|
||||
p = strtok(NULL, "/");
|
||||
if (p == NULL) {
|
||||
dns_zone_mkey_day =
|
||||
(24 * dns_zone_mkey_hour);
|
||||
dns_zone_mkey_month =
|
||||
(30 * dns_zone_mkey_day);
|
||||
break;
|
||||
}
|
||||
dns_zone_mkey_day = atoi(p);
|
||||
if (dns_zone_mkey_day < dns_zone_mkey_hour)
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
|
||||
p = strtok(NULL, "/");
|
||||
if (p == NULL) {
|
||||
dns_zone_mkey_month =
|
||||
(30 * dns_zone_mkey_day);
|
||||
break;
|
||||
}
|
||||
dns_zone_mkey_month = atoi(p);
|
||||
if (dns_zone_mkey_month < dns_zone_mkey_day)
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
} else if (!strcmp(isc_commandline_argument, "notcp"))
|
||||
notcp = ISC_TRUE;
|
||||
else if (!strncmp(isc_commandline_argument, "tat=", 4))
|
||||
{
|
||||
named_g_tat_interval =
|
||||
atoi(isc_commandline_argument + 4);
|
||||
} else if (!strcmp(isc_commandline_argument,
|
||||
"keepstderr"))
|
||||
{
|
||||
named_g_keepstderr = ISC_TRUE;
|
||||
} else if (!strcmp(isc_commandline_argument,
|
||||
"fixedlocal"))
|
||||
{
|
||||
fixedlocal = ISC_TRUE;
|
||||
} else {
|
||||
fprintf(stderr, "unknown -T flag '%s\n",
|
||||
isc_commandline_argument);
|
||||
}
|
||||
parse_T_opt(isc_commandline_argument);
|
||||
break;
|
||||
case 'U':
|
||||
named_g_udpdisp = parse_int(isc_commandline_argument,
|
||||
|
|
|
|||
Loading…
Reference in a new issue