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:
parent
b925086de0
commit
d3609225f5
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user