mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
ipfilter: Calculate the number of elements in ipf_errors
It serves no purpose to manually manage the IPF_NUM_ERRORS count. Calculate it instead. Reviewed by: emaste, markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53308
This commit is contained in:
1 parent
768ee6d454
commit
ab3c985328
1 file changed
+2
-2
@@ -17,7 +17,7 @@ typedef struct {
|
||||
|
||||
static ipf_error_entry_t *find_error(int);
|
||||
|
||||
#define IPF_NUM_ERRORS 477
|
||||
#define IPF_NUM_ERRORS sizeof(ipf_errors) / sizeof(ipf_error_entry_t)
|
||||
|
||||
/*
|
||||
* NO REUSE OF NUMBERS!
|
||||
@@ -25,7 +25,7 @@ static ipf_error_entry_t *find_error(int);
|
||||
* IF YOU WANT TO ADD AN ERROR TO THIS TABLE, _ADD_ A NEW NUMBER.
|
||||
* DO _NOT_ USE AN EMPTY NUMBER OR FILL IN A GAP.
|
||||
*/
|
||||
static ipf_error_entry_t ipf_errors[IPF_NUM_ERRORS] = {
|
||||
static ipf_error_entry_t ipf_errors[] = {
|
||||
{ 1, "auth table locked/full" },
|
||||
{ 2, "" },
|
||||
{ 3, "copyinptr received bad address" },
|
||||
|
||||
Reference in new issue
Block a user