/*
* If we have already seen a cookie option skip this cookie option.
*/
- if ((client->attributes & NS_CLIENTATTR_WANTCOOKIE) != 0) {
+ if ((!ns_g_server->answercookie) ||
+ (client->attributes & NS_CLIENTATTR_WANTCOOKIE) != 0)
+ {
isc_buffer_forward(buf, (unsigned int)optlen);
return;
}
/*% default configuration */
static char defaultconf[] = "\
options {\n\
+ answer-cookie true;\n\
automatic-interface-scan yes;\n\
bindkeys-file \"" NS_SYSCONFDIR "/bind.keys\";\n\
# blackhole {none;};\n"
unsigned char secret[32]; /*%< Server Cookie Secret */
ns_altsecretlist_t altsecrets;
ns_cookiealg_t cookiealg;
+ isc_boolean_t answercookie;
dns_dtenv_t *dtenv; /*%< Dnstap environment */
server->flushonshutdown = ISC_FALSE;
}
+ obj = NULL;
+ result = ns_config_get(maps, "answer-cookie", &obj);
+ INSIST(result == ISC_R_SUCCESS);
+ server->answercookie = cfg_obj_asboolean(obj);
+
obj = NULL;
result = ns_config_get(maps, "cookie-algorithm", &obj);
INSIST(result == ISC_R_SUCCESS);
server->lockfile = NULL;
server->dtenv = NULL;
+ server->answercookie = ISC_TRUE;
server->magic = NS_SERVER_MAGIC;
*serverp = server;
*/
static cfg_clausedef_t
options_clauses[] = {
+ { "answer-cookie", &cfg_type_boolean, CFG_CLAUSEFLAG_DEPRECATED },
{ "automatic-interface-scan", &cfg_type_boolean, 0 },
{ "avoid-v4-udp-ports", &cfg_type_bracketed_portlist, 0 },
{ "avoid-v6-udp-ports", &cfg_type_bracketed_portlist, 0 },