Add grease controls to the view structure

This commit is contained in:
Mark Andrews
2025-03-06 14:16:23 +11:00
parent dbe6a64971
commit ca184670a2
3 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -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 */
+14
View File
@@ -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.
+1
View File
@@ -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);