]> git.ipfire.org Git - thirdparty/bind9.git/commit
Update keymgr_key_is_successor() calls
authorMatthijs Mekking <matthijs@isc.org>
Thu, 7 Jan 2021 11:04:14 +0000 (12:04 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 3 Feb 2021 14:47:23 +0000 (15:47 +0100)
commit6ff0e99fa7f0ef0badf1f4e58bf54660c72dc966
tree2b73f543ee0e91c9a518b68a23873d5717d12b38
parent5e40515671f769ae477d5a043852bdf50ec23360
Update keymgr_key_is_successor() calls

The previous commit changed the function definition of
'keymgr_key_is_successor()', this commit updates the code where
this function is called.

In 'keymgr_key_exists_with_state()' the logic is also updated slightly
to become more readable. First handle the easy cases:
- If the key does not match the state, continue with the next key.
- If we found a key with matching state, and there is no need to
  check the successor relationship, return (true).
- Otherwise check the successor relationship.

In 'keymgr_key_has_successor()' it is enough to check if a key has
a direct successor, so instead of calling 'keymgr_key_is_successor()',
we can just check 'keymgr_direct_dep()'.

In 'dns_keymgr_run()', we want to make sure that there is no
dependency on the keys before retiring excess keys, so replace
'keymgr_key_is_successor()' with 'keymgr_dep()'.

(cherry picked from commit 600915d1b204d7b35e83c833f0993bc6987088fd)
lib/dns/keymgr.c