mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-24 19:18:50 +00:00
Similarly to how different code paths reused common client handle pointers and fetch references despite being logically unrelated, they also reuse client->recursionquota, the field in which a reference to the recursion quota is stored. This unnecessarily forces all code using that field to be aware of the fact that it is overloaded by different features. Overloading client->recursionquota also causes inconsistent behavior. For example, if prefetch code triggers recursion and then delegation handling code also triggers recursion, only one of these code paths will be able to attach to the recursion quota, but both recursions will be started anyway. In other words, each code path only checks whether the recursion quota has not been exceeded if the quota has not yet been attached to by another code path. This behavior theoretically allows the configured recursion quota to be slightly exceeded; while it is not expected to be a real-world operational issue, it is still confusing and should therefore be fixed. Extend the structures comprising the 'recursions' array with a new field holding a pointer to the recursion quota that a given recursion process attached to. Update all code paths using client->recursionquota so that they use the appropriate slot in the 'recursions' array. Drop the 'recursionquota' field from ns_client_t.