svn commit: r201063 - user/luigi/ipfw3-head/sys/netinet/ipfw
Luigi Rizzo
luigi at FreeBSD.org
Sun Dec 27 22:13:19 UTC 2009
Author: luigi
Date: Sun Dec 27 22:13:19 2009
New Revision: 201063
URL: http://svn.freebsd.org/changeset/base/201063
Log:
use a less obfuscated construct to call the hook/unhook functions
Modified:
user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c
Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c Sun Dec 27 21:58:48 2009 (r201062)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c Sun Dec 27 22:13:19 2009 (r201063)
@@ -329,18 +329,17 @@ ipfw_divert(struct mbuf **m0, int incomi
static int
ipfw_hook(int onoff, int pf)
{
+ const int arg = PFIL_IN | PFIL_OUT | PFIL_WAITOK;
struct pfil_head *pfh;
- int (*fn)(int (*pfil_func)(void *, struct mbuf **,
- struct ifnet *, int, struct inpcb *),
- void *, int, struct pfil_head *);
-
pfh = pfil_head_get(PFIL_TYPE_AF, pf);
if (pfh == NULL)
return ENOENT;
- fn = (onoff) ? pfil_add_hook : pfil_remove_hook;
- (void)fn(ipfw_check_hook, NULL, PFIL_IN | PFIL_OUT | PFIL_WAITOK, pfh);
+ if (onoff)
+ (void)pfil_add_hook(ipfw_check_hook, NULL, arg, pfh);
+ else
+ (void)pfil_remove_hook(ipfw_check_hook, NULL, arg, pfh);
return 0;
}
More information about the svn-src-user
mailing list