Make sure tunable sysctls are only fetched once. The existing code can

re-register sysctls when destroying sysctl contexts or when moving
sysctls from one tree to another.
This commit is contained in:
hselasky 2015-03-24 17:42:53 +00:00
parent b925086de0
commit d3609225f5

View File

@ -353,6 +353,9 @@ sysctl_register_oid(struct sysctl_oid *oidp)
#endif
(oidp->oid_kind & CTLFLAG_TUN) != 0 &&
(oidp->oid_kind & CTLFLAG_NOFETCH) == 0) {
/* only fetch value once */
oidp->oid_kind |= CTLFLAG_NOFETCH;
/* try to fetch value from kernel environment */
sysctl_load_tunable_by_oid_locked(oidp);
}
}