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.
This commit is contained in:
parent
27a550e5ed
commit
88fbb423d4
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user