Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Context not available. | |||||
struct ip *ip = mtod(*mp, struct ip *); | struct ip *ip = mtod(*mp, struct ip *); | ||||
int rv; | int rv; | ||||
if (dir == PFIL_FWD) | |||||
dir = PFIL_OUT; | |||||
/* | /* | ||||
* IPFilter expects evreything in network byte order | * IPFilter expects evreything in network byte order | ||||
*/ | */ | ||||
Context not available. | |||||
{ | { | ||||
int error; | int error; | ||||
if (dir == PFIL_FWD) | |||||
dir = PFIL_OUT; | |||||
CURVNET_SET(ifp->if_vnet); | CURVNET_SET(ifp->if_vnet); | ||||
error = ipf_check(&V_ipfmain, mtod(*mp, struct ip *), | error = ipf_check(&V_ipfmain, mtod(*mp, struct ip *), | ||||
sizeof(struct ip6_hdr), ifp, (dir == PFIL_OUT), mp); | sizeof(struct ip6_hdr), ifp, (dir == PFIL_OUT), mp); | ||||
Context not available. | |||||
ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); | ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); | ||||
if (ph_inet != NULL) | if (ph_inet != NULL) | ||||
pfil_remove_hook((void *)ipf_check_wrapper, NULL, | pfil_remove_hook((void *)ipf_check_wrapper, NULL, | ||||
PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet); | PFIL_IN|PFIL_OUT|PFIL_FWD|PFIL_WAITOK, ph_inet); | ||||
# ifdef USE_INET6 | # ifdef USE_INET6 | ||||
ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); | ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); | ||||
if (ph_inet6 != NULL) | if (ph_inet6 != NULL) | ||||
pfil_remove_hook((void *)ipf_check_wrapper6, NULL, | pfil_remove_hook((void *)ipf_check_wrapper6, NULL, | ||||
PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); | PFIL_IN|PFIL_OUT|PFIL_FWD|PFIL_WAITOK, ph_inet6); | ||||
# endif | # endif | ||||
#endif | #endif | ||||
Context not available. | |||||
if (ph_inet != NULL) | if (ph_inet != NULL) | ||||
pfil_add_hook((void *)ipf_check_wrapper, NULL, | pfil_add_hook((void *)ipf_check_wrapper, NULL, | ||||
PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet); | PFIL_IN|PFIL_OUT|PFIL_FWD|PFIL_WAITOK, ph_inet); | ||||
# ifdef USE_INET6 | # ifdef USE_INET6 | ||||
if (ph_inet6 != NULL) | if (ph_inet6 != NULL) | ||||
pfil_add_hook((void *)ipf_check_wrapper6, NULL, | pfil_add_hook((void *)ipf_check_wrapper6, NULL, | ||||
PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); | PFIL_IN|PFIL_OUT|PFIL_FWD|PFIL_WAITOK, ph_inet6); | ||||
# endif | # endif | ||||
# endif | # endif | ||||
return (0); | return (0); | ||||
Context not available. |