View | Details | Raw Unified | Return to bug 29131 | Differences between
and this patch

Collapse All | Expand All

(-)src/sys/kern/kern_sysctl.c (-1 / +3 lines)
Lines 113-123 Link Here
113
	 * 100 to leave space for pre-assigned oid numbers.
113
	 * 100 to leave space for pre-assigned oid numbers.
114
	 */
114
	 */
115
	if (oidp->oid_number == OID_AUTO) {
115
	if (oidp->oid_number == OID_AUTO) {
116
		static int newoid = 100;
116
		static int newoid = CTL_AUTO_START;
117
117
118
		oidp->oid_number = newoid++;
118
		oidp->oid_number = newoid++;
119
		if (newoid == 0x7fffffff)
119
		if (newoid == 0x7fffffff)
120
			panic("out of oids");
120
			panic("out of oids");
121
	} else if (oidp->oid_number >= CTL_AUTO_START) {
122
		panic("static sysctl oid too high: %d", oidp->oid_number);
121
	}
123
	}
122
124
123
	/*
125
	/*
(-)src/sys/sys/sysctl.h (+6 lines)
Lines 95-100 Link Here
95
 */ 
95
 */ 
96
#define OID_AUTO	(-1)
96
#define OID_AUTO	(-1)
97
97
98
/*
99
 * The starting number for dynamically-assigned entries.  WARNING!
100
 * ALL static sysctl entries should have numbers LESS than this!
101
 */
102
#define CTL_AUTO_START	0x100
103
98
#ifdef _KERNEL
104
#ifdef _KERNEL
99
#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
105
#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
100
	struct sysctl_req *req
106
	struct sysctl_req *req

Return to bug 29131