2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Disable periodic interface re-scans on modern platforms

This commit disables periodic interface re-scans timer on Linux where
a kernel-based dynamic interface mechanisms make it a thing of the
past in most cases.
This commit is contained in:
Artem Boldariev
2022-04-08 15:32:10 +03:00
parent 9da576c2ba
commit b58c4b8462
3 changed files with 54 additions and 10 deletions

View File

@@ -190,3 +190,11 @@ ns_interfacemgr_getclientmgr(ns_interfacemgr_t *mgr);
* Returns the client manager for the current worker thread.
* (This cannot be run from outside a network manager thread.)
*/
bool
ns_interfacemgr_dynamic_updates_are_reliable(void);
/*%<
* Returns 'true' if periodic interface re-scans timer should be
* disabled. That is the case on the platforms where kernel-based
* mechanisms for tracking networking interface states is reliable enough.
*/

View File

@@ -1379,3 +1379,17 @@ ns_interfacemgr_getclientmgr(ns_interfacemgr_t *mgr) {
return (mgr->clientmgrs[tid]);
}
bool
ns_interfacemgr_dynamic_updates_are_reliable(void) {
#if defined(LINUX_NETLINK_AVAILABLE)
/*
* Let's disable periodic interface rescans on Linux, as there a
* reliable kernel-based mechanism for tracking interface state
* changes is available.
*/
return (true);
#else
return (false);
#endif /* LINUX_NETLINK_AVAILABLE */
}