summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2013-08-24 10:36:33 +0000
committerandre <andre@FreeBSD.org>2013-08-24 10:36:33 +0000
commitf0d721b842a1a9782a947267e3c0724066e223a0 (patch)
treeeb56507a7b6483a999116b24cf34add6363c5c24 /sys
parent8095dac6a243c9f42f6ec86e671e00b39b0c133f (diff)
downloadFreeBSD-src-f0d721b842a1a9782a947267e3c0724066e223a0.zip
FreeBSD-src-f0d721b842a1a9782a947267e3c0724066e223a0.tar.gz
Internalize pfil_hook_get(). There are no outside consumers of
this API, it is only safe for internal use and even the pfil(9) man page says so in the BUGS section. Reviewed by: eri
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pfil.c13
-rw-r--r--sys/net/pfil.h12
2 files changed, 13 insertions, 12 deletions
diff --git a/sys/net/pfil.c b/sys/net/pfil.c
index fc7a5ae..51c22a1 100644
--- a/sys/net/pfil.c
+++ b/sys/net/pfil.c
@@ -52,6 +52,7 @@ static struct mtx pfil_global_lock;
MTX_SYSINIT(pfil_heads_lock, &pfil_global_lock, "pfil_head_list lock",
MTX_DEF);
+static struct packet_filter_hook *pfil_hook_get(int, struct pfil_head *);
static int pfil_list_add(pfil_list_t *, struct packet_filter_hook *, int);
static int pfil_list_remove(pfil_list_t *, pfil_func_t, void *);
@@ -89,6 +90,18 @@ pfil_run_hooks(struct pfil_head *ph, struct mbuf **mp, struct ifnet *ifp,
return (rv);
}
+static struct packet_filter_hook *
+pfil_hook_get(int dir, struct pfil_head *ph)
+{
+
+ if (dir == PFIL_IN)
+ return (TAILQ_FIRST(&ph->ph_in));
+ else if (dir == PFIL_OUT)
+ return (TAILQ_FIRST(&ph->ph_out));
+ else
+ return (NULL);
+}
+
/*
* pfil_try_rlock() acquires rm reader lock for specified head
* if this is immediately possible.
diff --git a/sys/net/pfil.h b/sys/net/pfil.h
index b91328f..5c763dc 100644
--- a/sys/net/pfil.h
+++ b/sys/net/pfil.h
@@ -132,16 +132,4 @@ struct pfil_head *pfil_head_get(int, u_long);
#define PFIL_LIST_LOCK() mtx_lock(&pfil_global_lock)
#define PFIL_LIST_UNLOCK() mtx_unlock(&pfil_global_lock)
-static __inline struct packet_filter_hook *
-pfil_hook_get(int dir, struct pfil_head *ph)
-{
-
- if (dir == PFIL_IN)
- return (TAILQ_FIRST(&ph->ph_in));
- else if (dir == PFIL_OUT)
- return (TAILQ_FIRST(&ph->ph_out));
- else
- return (NULL);
-}
-
#endif /* _NET_PFIL_H_ */
OpenPOWER on IntegriCloud