Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | static void ipf_ifevent(arg, ifp) | ||||
if (V_ipfmain.ipf_running > 0) | if (V_ipfmain.ipf_running > 0) | ||||
ipf_sync(&V_ipfmain, NULL); | ipf_sync(&V_ipfmain, NULL); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
static int | static int | ||||
ipf_check_wrapper(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir) | ipf_check_wrapper(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir, | ||||
int flags) | |||||
{ | { | ||||
struct ip *ip = mtod(*mp, struct ip *); | struct ip *ip = mtod(*mp, struct ip *); | ||||
int rv; | int rv; | ||||
/* | /* | ||||
* IPFilter expects evreything in network byte order | * IPFilter expects evreything in network byte order | ||||
*/ | */ | ||||
#if (__FreeBSD_version < 1000019) | #if (__FreeBSD_version < 1000019) | ||||
Show All 13 Lines | |||||
#endif | #endif | ||||
return rv; | return rv; | ||||
} | } | ||||
# ifdef USE_INET6 | # ifdef USE_INET6 | ||||
# include <netinet/ip6.h> | # include <netinet/ip6.h> | ||||
static int | static int | ||||
ipf_check_wrapper6(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir) | ipf_check_wrapper6(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir, | ||||
int flags) | |||||
{ | { | ||||
int error; | int error; | ||||
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); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 1,299 Lines • Show Last 20 Lines |