From owner-svn-src-head@FreeBSD.ORG Sat Aug 24 10:36:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 58D23DAF; Sat, 24 Aug 2013 10:36:34 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2857C26C7; Sat, 24 Aug 2013 10:36:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OAaYpH010899; Sat, 24 Aug 2013 10:36:34 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OAaXTl010897; Sat, 24 Aug 2013 10:36:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241036.r7OAaXTl010897@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 10:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254771 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 10:36:34 -0000 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_ */