summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authorroam <roam@FreeBSD.org>2001-10-12 09:16:36 +0000
committerroam <roam@FreeBSD.org>2001-10-12 09:16:36 +0000
commit64e1aedd27eb79684e48d08ce7ae969dc234dad5 (patch)
tree6a4a7fac536a3e979cde948e23c13e4e9e1ba52e /sys/kern/kern_sysctl.c
parenta05a408d1477a5343412025e2e3b23c405a7d380 (diff)
downloadFreeBSD-src-64e1aedd27eb79684e48d08ce7ae969dc234dad5.zip
FreeBSD-src-64e1aedd27eb79684e48d08ce7ae969dc234dad5.tar.gz
Remove the panic when trying to register a sysctl with an oid too high.
This stops panics on unloading modules which define their own sysctl sets. However, this also removes the protection against somebody actually defining a static sysctl with an oid in the range of the dynamic ones, which would break badly if there is already a dynamic sysctl with the requested oid. Apparently, the algorithm for removing sysctl sets needs a bit more work. For the present, the panic I introduced only leads to Bad Things (tm). Submitted by: many users of -current :( Pointy hat to: roam (myself) for not testing rev. 1.112 enough.
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 7ebdf82..03b5a95 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -123,9 +123,13 @@ sysctl_register_oid(struct sysctl_oid *oidp)
oidp->oid_number = newoid++;
if (newoid == 0x7fffffff)
panic("out of oids");
- } else if (oidp->oid_number >= CTL_AUTO_START) {
- panic("static sysctl oid too high: %d", oidp->oid_number);
}
+#if 0
+ else if (oidp->oid_number >= CTL_AUTO_START) {
+ /* do not panic; this happens when unregistering sysctl sets */
+ printf("static sysctl oid too high: %d", oidp->oid_number);
+ }
+#endif
/*
* Insert the oid into the parent's list in order.
OpenPOWER on IntegriCloud