Add grease controls to the view structure
This commit is contained in:
@@ -99,7 +99,8 @@
|
||||
#define DNS_MESSAGEFLAG_CD 0x0010U
|
||||
|
||||
/*%< EDNS0 extended message flags */
|
||||
#define DNS_MESSAGEEXTFLAG_DO 0x8000U
|
||||
#define DNS_MESSAGEEXTFLAG_DO 0x8000U
|
||||
#define DNS_MESSAGEEXTFLAG_KNOWN_FLAGS DNS_MESSAGEEXTFLAG_DO
|
||||
|
||||
/*%< EDNS0 extended OPT codes */
|
||||
|
||||
|
||||
@@ -186,6 +186,20 @@ struct dns_view {
|
||||
uint16_t max_queries;
|
||||
uint8_t max_restarts;
|
||||
|
||||
/*
|
||||
* Grease the protocol by sending possible future
|
||||
* changes and checking the result matches defined
|
||||
* behaviour.
|
||||
*/
|
||||
bool grease_dns_flags; /* DNS flag 0x40 */
|
||||
bool grease_edns_flags; /* EDNS Unknown flags */
|
||||
bool grease_edns_neg; /* EDNS version negotiation */
|
||||
bool grease_nsid; /* Request NSID */
|
||||
uint8_t grease_edns_max_version; /* Currently 0 */
|
||||
uint16_t grease_edns_known_flags; /* Don't grease these flags */
|
||||
unsigned int grease_rate; /* Grease this % of queries */
|
||||
time_t grease_until; /* Turn off flags greasing at this time */
|
||||
|
||||
/*
|
||||
* Configurable data for server use only,
|
||||
* locked by server configuration lock.
|
||||
|
||||
@@ -120,6 +120,7 @@ dns_view_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr,
|
||||
.root_key_sentinel = true,
|
||||
.udpsize = DEFAULT_EDNS_BUFSIZE,
|
||||
.max_restarts = DEFAULT_MAX_RESTARTS,
|
||||
.grease_edns_known_flags = DNS_MESSAGEEXTFLAG_KNOWN_FLAGS,
|
||||
};
|
||||
|
||||
isc_refcount_init(&view->references, 1);
|
||||
|
||||
Reference in New Issue
Block a user