mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 18:50:31 -04:00
pfctl: Rewrite some ugly for loops
This fixes a few KNF issues and ugly line wrapping by using a local
version of nitems(); fix two bsearch() on top.
ok claudio
FreeBSD note: we already used nitems(), but now pick up the use of size_t over
unsigned int.
Obtained from: OpenBSD, tb <tb@openbsd.org>, 3d49904c6e
Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
parent
67082c75f7
commit
d64ba46792
1 changed files with 4 additions and 4 deletions
|
|
@ -242,7 +242,7 @@ copy_satopfaddr(struct pf_addr *pfa, struct sockaddr *sa)
|
|||
const struct icmptypeent *
|
||||
geticmptypebynumber(u_int8_t type, sa_family_t af)
|
||||
{
|
||||
unsigned int i;
|
||||
size_t i;
|
||||
|
||||
if (af != AF_INET6) {
|
||||
for (i=0; i < nitems(icmp_type); i++) {
|
||||
|
|
@ -261,7 +261,7 @@ geticmptypebynumber(u_int8_t type, sa_family_t af)
|
|||
const struct icmptypeent *
|
||||
geticmptypebyname(char *w, sa_family_t af)
|
||||
{
|
||||
unsigned int i;
|
||||
size_t i;
|
||||
|
||||
if (af != AF_INET6) {
|
||||
for (i=0; i < nitems(icmp_type); i++) {
|
||||
|
|
@ -280,7 +280,7 @@ geticmptypebyname(char *w, sa_family_t af)
|
|||
const struct icmpcodeent *
|
||||
geticmpcodebynumber(u_int8_t type, u_int8_t code, sa_family_t af)
|
||||
{
|
||||
unsigned int i;
|
||||
size_t i;
|
||||
|
||||
if (af != AF_INET6) {
|
||||
for (i=0; i < nitems(icmp_code); i++) {
|
||||
|
|
@ -301,7 +301,7 @@ geticmpcodebynumber(u_int8_t type, u_int8_t code, sa_family_t af)
|
|||
const struct icmpcodeent *
|
||||
geticmpcodebyname(u_long type, char *w, sa_family_t af)
|
||||
{
|
||||
unsigned int i;
|
||||
size_t i;
|
||||
|
||||
if (af != AF_INET6) {
|
||||
for (i=0; i < nitems(icmp_code); i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue