/*% default configuration */
static char defaultconf[] = "\
options {\n\
+ answer-cookie true;\n\
automatic-interface-scan yes;\n\
bindkeys-file \"" NAMED_SYSCONFDIR "/bind.keys\";\n\
# blackhole {none;};\n"
server->flushonshutdown = ISC_FALSE;
}
+ obj = NULL;
+ result = named_config_get(maps, "answer-cookie", &obj);
+ INSIST(result == ISC_R_SUCCESS);
+ server->sctx->answercookie = cfg_obj_asboolean(obj);
+
obj = NULL;
result = named_config_get(maps, "cookie-algorithm", &obj);
INSIST(result == ISC_R_SUCCESS);
*/
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 },
/*
* If we have already seen a cookie option skip this cookie option.
*/
- if ((client->attributes & NS_CLIENTATTR_WANTCOOKIE) != 0) {
+ if ((!client->sctx->answercookie) ||
+ (client->attributes & NS_CLIENTATTR_WANTCOOKIE) != 0)
+ {
isc_buffer_forward(buf, (unsigned int)optlen);
return;
}
unsigned char secret[32];
ns_cookiealg_t cookiealg;
ns_altsecretlist_t altsecrets;
+ isc_boolean_t answercookie;
/*% Quotas */
isc_quota_t recursionquota;
sctx->gethostname = NULL;
sctx->matchingview = matchingview;
+ sctx->answercookie = ISC_TRUE;
ISC_LIST_INIT(sctx->altsecrets);