svn commit: r254771 - head/sys/net

Andre Oppermann andre at FreeBSD.org
Sat Aug 24 10:36:34 UTC 2013


Author: andre
Date: Sat Aug 24 10:36:33 2013
New Revision: 254771
URL: http://svnweb.freebsd.org/changeset/base/254771

Log:
  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

Modified:
  head/sys/net/pfil.c
  head/sys/net/pfil.h

Modified: head/sys/net/pfil.c
==============================================================================
--- head/sys/net/pfil.c	Sat Aug 24 10:30:20 2013	(r254770)
+++ head/sys/net/pfil.c	Sat Aug 24 10:36:33 2013	(r254771)
@@ -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, str
 	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.

Modified: head/sys/net/pfil.h
==============================================================================
--- head/sys/net/pfil.h	Sat Aug 24 10:30:20 2013	(r254770)
+++ head/sys/net/pfil.h	Sat Aug 24 10:36:33 2013	(r254771)
@@ -132,16 +132,4 @@ struct pfil_head *pfil_head_get(int, u_l
 #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_ */


More information about the svn-src-all mailing list