SyncRes::s_ecscachelimitttl = ::arg().asNum("ecs-cache-limit-ttl");
SyncRes::s_qnameminimization = ::arg().mustDo("qname-minimization");
+ SyncRes::s_minimize_one_lab = ::arg().asNum("qname-minimize-one-label");
+ SyncRes::s_max_minimize_count = ::arg().asNum("qname-max-minimize-count");
SyncRes::s_hardenNXD = SyncRes::HardenNXD::DNSSEC;
string value = ::arg()["nothing-below-nxdomain"];
'help' : 'Use Query Name Minimization',
'doc' : '''
Enable Query Name Minimization. This implements a relaxed form of Query Name Mimimization as
-described in :rfc:`7816`.
+described in :rfc:`9156`.
''',
'versionadded': '4.3.0'
},
+ {
+ 'name' : 'qname_max_minimize_count',
+ 'section' : 'recursor',
+ 'type' : LType.Uint64,
+ 'default' : '10',
+ 'help' : 'RFC9156 max minimize count',
+ 'doc' : '''
+``Max minimize count`` parameter, described in :rfc:`9156`. This is the maximum number of iterations
+of the Quqey Name Minimization Algorithm.
+ ''',
+ 'versionadded': '5.0.0'
+ },
+ {
+ 'name' : 'qname_minimize_one_label',
+ 'section' : 'recursor',
+ 'type' : LType.Uint64,
+ 'default' : '4',
+ 'help' : 'RFC9156 minimize one label parameter',
+ 'doc' : '''
+``Minimize one label`` parameter, described in :rfc:`9156`.
+The value for the number of iterations of the Query Name Minimization Algorithm that should only have one label appended.
+ ''',
+ 'versionadded': '5.0.0'
+ },
{
'name' : 'source_address',
'section' : 'outgoing',
}
/* The parameters from rfc9156. */
-/* maximum number of QNAME minimisation iterations */
-static const unsigned int s_max_minimise_count = 10;
-/* number of queries that should only have one label appended */
-static const unsigned int s_minimise_one_lab = 4;
+/* maximum number of QNAME minimization iterations */
+unsigned int SyncRes::s_max_minimize_count; // default is 10
+/* number of iterations that should only have one label appended */
+unsigned int SyncRes::s_minimize_one_lab; // default is 4
static unsigned int qmStepLen(unsigned int labels, unsigned int qnamelen, unsigned int i)
{
unsigned int step;
- if (i < s_minimise_one_lab) {
+ if (i < SyncRes::s_minimize_one_lab) {
step = 1;
}
- else if (i < s_max_minimise_count) {
- step = std::max(1U, (qnamelen - labels) / (10 - i));
+ else if (i < SyncRes::s_max_minimize_count) {
+ step = std::max(1U, (qnamelen - labels) / (SyncRes::s_max_minimize_count - i));
}
else {
step = qnamelen - labels;
LOG(prefix << qname << ": Step4 Resolve " << child << "|A result is " << RCode::to_s(res) << "/" << retq.size() << "/" << stopAtDelegation << endl);
if (stopAtDelegation == Stopped) {
LOG(prefix << qname << ": Delegation seen, continue at step 1" << endl);
+ i++;
break;
}
static bool s_dot_to_port_853;
static unsigned int s_max_busy_dot_probes;
static unsigned int s_max_CNAMES_followed;
+ static unsigned int s_max_minimize_count;
+ static unsigned int s_minimize_one_lab;
static const int event_trace_to_pb = 1;
static const int event_trace_to_log = 2;