Date: Mon, 4 Jan 2010 10:38:54 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r201485 - user/luigi/ipfw3-head/sys/netinet/ipfw Message-ID: <201001041038.o04Acs3M031640@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Mon Jan 4 10:38:54 2010 New Revision: 201485 URL: http://svn.freebsd.org/changeset/base/201485 Log: more compact expression of variant function 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 Mon Jan 4 10:37:07 2010 (r201484) +++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c Mon Jan 4 10:38:54 2010 (r201485) @@ -322,17 +322,14 @@ 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; pfh = pfil_head_get(PFIL_TYPE_AF, pf); if (pfh == NULL) return ENOENT; - if (onoff) - (void)pfil_add_hook(ipfw_check_hook, NULL, arg, pfh); - else - (void)pfil_remove_hook(ipfw_check_hook, NULL, arg, pfh); + (void) (onoff ? pfil_add_hook : pfil_remove_hook) + (ipfw_check_hook, NULL, PFIL_IN | PFIL_OUT | PFIL_WAITOK, pfh); return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001041038.o04Acs3M031640>