Deleted Added
full compact
pf_ioctl.c (293893) pf_ioctl.c (286014)
1/*-
2 * Copyright (c) 2001 Daniel Hartmeier
3 * Copyright (c) 2002,2003 Henning Brauer
4 * Copyright (c) 2012 Gleb Smirnoff <glebius@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 22 unchanged lines hidden (view full) ---

31 * Effort sponsored in part by the Defense Advanced Research Projects
32 * Agency (DARPA) and Air Force Research Laboratory, Air Force
33 * Materiel Command, USAF, under agreement number F30602-01-2-0537.
34 *
35 * $OpenBSD: pf_ioctl.c,v 1.213 2009/02/15 21:46:12 mbalmer Exp $
36 */
37
38#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Daniel Hartmeier
3 * Copyright (c) 2002,2003 Henning Brauer
4 * Copyright (c) 2012 Gleb Smirnoff <glebius@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 22 unchanged lines hidden (view full) ---

31 * Effort sponsored in part by the Defense Advanced Research Projects
32 * Agency (DARPA) and Air Force Research Laboratory, Air Force
33 * Materiel Command, USAF, under agreement number F30602-01-2-0537.
34 *
35 * $OpenBSD: pf_ioctl.c,v 1.213 2009/02/15 21:46:12 mbalmer Exp $
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: releng/10.2/sys/netpfil/pf/pf_ioctl.c 293893 2016-01-14 09:10:46Z glebius $");
39__FBSDID("$FreeBSD: releng/10.2/sys/netpfil/pf/pf_ioctl.c 286014 2015-07-29 14:16:25Z glebius $");
40
41#include "opt_inet.h"
42#include "opt_inet6.h"
43#include "opt_bpf.h"
44#include "opt_pf.h"
45
46#include <sys/param.h>
47#include <sys/bus.h>

--- 3508 unchanged lines hidden (view full) ---

3556}
3557
3558static int
3559pf_check_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir,
3560 struct inpcb *inp)
3561{
3562 int chk;
3563
40
41#include "opt_inet.h"
42#include "opt_inet6.h"
43#include "opt_bpf.h"
44#include "opt_pf.h"
45
46#include <sys/param.h>
47#include <sys/bus.h>

--- 3508 unchanged lines hidden (view full) ---

3556}
3557
3558static int
3559pf_check_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir,
3560 struct inpcb *inp)
3561{
3562 int chk;
3563
3564 /* We need a proper CSUM befor we start (s. OpenBSD ip_output) */
3565 if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
3566 in_delayed_cksum(*m);
3567 (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
3568 }
3569
3564 chk = pf_test(PF_OUT, ifp, m, inp);
3565 if (chk && *m) {
3566 m_freem(*m);
3567 *m = NULL;
3568 }
3569
3570 return (chk);
3571}

--- 22 unchanged lines hidden (view full) ---

3594}
3595
3596static int
3597pf_check6_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir,
3598 struct inpcb *inp)
3599{
3600 int chk;
3601
3570 chk = pf_test(PF_OUT, ifp, m, inp);
3571 if (chk && *m) {
3572 m_freem(*m);
3573 *m = NULL;
3574 }
3575
3576 return (chk);
3577}

--- 22 unchanged lines hidden (view full) ---

3600}
3601
3602static int
3603pf_check6_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir,
3604 struct inpcb *inp)
3605{
3606 int chk;
3607
3608 /* We need a proper CSUM before we start (s. OpenBSD ip_output) */
3609 if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) {
3610 in6_delayed_cksum(*m,
3611 (*m)->m_pkthdr.len - sizeof(struct ip6_hdr),
3612 sizeof(struct ip6_hdr));
3613 (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6;
3614 }
3602 CURVNET_SET(ifp->if_vnet);
3603 chk = pf_test6(PF_OUT, ifp, m, inp);
3604 CURVNET_RESTORE();
3605 if (chk && *m) {
3606 m_freem(*m);
3607 *m = NULL;
3608 }
3609 return chk;

--- 179 unchanged lines hidden ---
3615 CURVNET_SET(ifp->if_vnet);
3616 chk = pf_test6(PF_OUT, ifp, m, inp);
3617 CURVNET_RESTORE();
3618 if (chk && *m) {
3619 m_freem(*m);
3620 *m = NULL;
3621 }
3622 return chk;

--- 179 unchanged lines hidden ---