Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/pf/pf_ioctl.c
Show First 20 Lines • Show All 3,560 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
pf_check_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, | pf_check_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, | ||||
struct inpcb *inp) | struct inpcb *inp) | ||||
{ | { | ||||
int chk; | int chk; | ||||
/* We need a proper CSUM befor we start (s. OpenBSD ip_output) */ | |||||
if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | |||||
in_delayed_cksum(*m); | |||||
(*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | |||||
} | |||||
chk = pf_test(PF_OUT, ifp, m, inp); | chk = pf_test(PF_OUT, ifp, m, inp); | ||||
if (chk && *m) { | if (chk && *m) { | ||||
m_freem(*m); | m_freem(*m); | ||||
*m = NULL; | *m = NULL; | ||||
} | } | ||||
return (chk); | return (chk); | ||||
} | } | ||||
Show All 22 Lines | |||||
} | } | ||||
static int | static int | ||||
pf_check6_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, | pf_check6_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, | ||||
struct inpcb *inp) | struct inpcb *inp) | ||||
{ | { | ||||
int chk; | int chk; | ||||
/* We need a proper CSUM before we start (s. OpenBSD ip_output) */ | |||||
if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { | |||||
in6_delayed_cksum(*m, | |||||
(*m)->m_pkthdr.len - sizeof(struct ip6_hdr), | |||||
sizeof(struct ip6_hdr)); | |||||
(*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; | |||||
} | |||||
CURVNET_SET(ifp->if_vnet); | CURVNET_SET(ifp->if_vnet); | ||||
chk = pf_test6(PF_OUT, ifp, m, inp); | chk = pf_test6(PF_OUT, ifp, m, inp); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
if (chk && *m) { | if (chk && *m) { | ||||
m_freem(*m); | m_freem(*m); | ||||
*m = NULL; | *m = NULL; | ||||
} | } | ||||
return chk; | return chk; | ||||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |