Deleted Added
full compact
ip_fil_freebsd.c (192895) ip_fil_freebsd.c (195699)
1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c 192895 2009-05-27 14:11:23Z jamie $ */
1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c 195699 2009-07-14 22:48:30Z rwatson $ */
2
3/*
4 * Copyright (C) 1993-2003 by Darren Reed.
5 *
6 * See the IPFILTER.LICENCE file for details on licencing.
7 */
8#if !defined(lint)
9static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";

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

59#include <sys/socket.h>
60#if __FreeBSD_version >= 500043
61# include <sys/selinfo.h>
62#else
63# include <sys/select.h>
64#endif
65#if __FreeBSD_version >= 800044
66# include <sys/vimage.h>
2
3/*
4 * Copyright (C) 1993-2003 by Darren Reed.
5 *
6 * See the IPFILTER.LICENCE file for details on licencing.
7 */
8#if !defined(lint)
9static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";

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

59#include <sys/socket.h>
60#if __FreeBSD_version >= 500043
61# include <sys/selinfo.h>
62#else
63# include <sys/select.h>
64#endif
65#if __FreeBSD_version >= 800044
66# include <sys/vimage.h>
67# include <netinet/tcp_var.h>
67#else
68#define V_path_mtu_discovery path_mtu_discovery
69#define V_ipforwarding ipforwarding
70#endif
71
72#include <net/if.h>
73#if __FreeBSD_version >= 300000
74# include <net/if_var.h>

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

87#include <netinet/ip_var.h>
88#include <netinet/tcp.h>
89#if defined(__osf__)
90# include <netinet/tcp_timer.h>
91#endif
92#include <netinet/udp.h>
93#include <netinet/tcpip.h>
94#include <netinet/ip_icmp.h>
68#else
69#define V_path_mtu_discovery path_mtu_discovery
70#define V_ipforwarding ipforwarding
71#endif
72
73#include <net/if.h>
74#if __FreeBSD_version >= 300000
75# include <net/if_var.h>

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

88#include <netinet/ip_var.h>
89#include <netinet/tcp.h>
90#if defined(__osf__)
91# include <netinet/tcp_timer.h>
92#endif
93#include <netinet/udp.h>
94#include <netinet/tcpip.h>
95#include <netinet/ip_icmp.h>
95#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800056)
96# include <netinet/vinet.h>
97#endif
98#ifndef _KERNEL
99# include "netinet/ipf.h"
100#endif
101#include "netinet/ip_compat.h"
102#ifdef USE_INET6
103# include <netinet/icmp6.h>
104#endif
105#include "netinet/ip_fil.h"

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

208 return 1;
209 return 0;
210}
211#endif /* IPFILTER_LKM */
212
213
214int ipfattach()
215{
96#ifndef _KERNEL
97# include "netinet/ipf.h"
98#endif
99#include "netinet/ip_compat.h"
100#ifdef USE_INET6
101# include <netinet/icmp6.h>
102#endif
103#include "netinet/ip_fil.h"

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

206 return 1;
207 return 0;
208}
209#endif /* IPFILTER_LKM */
210
211
212int ipfattach()
213{
216 INIT_VNET_INET(curvnet);
217#ifdef USE_SPL
218 int s;
219#endif
220
221 SPL_NET(s);
222 if (fr_running > 0) {
223 SPL_X(s);
224 return EBUSY;

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

260
261
262/*
263 * Disable the filter by removing the hooks from the IP input/output
264 * stream.
265 */
266int ipfdetach()
267{
214#ifdef USE_SPL
215 int s;
216#endif
217
218 SPL_NET(s);
219 if (fr_running > 0) {
220 SPL_X(s);
221 return EBUSY;

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

257
258
259/*
260 * Disable the filter by removing the hooks from the IP input/output
261 * stream.
262 */
263int ipfdetach()
264{
268 INIT_VNET_INET(curvnet);
269#ifdef USE_SPL
270 int s;
271#endif
272 if (fr_control_forwarding & 2)
273 V_ipforwarding = 0;
274
275 SPL_NET(s);
276

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

649 return fr_send_ip(fin, m, &m);
650}
651
652
653static int fr_send_ip(fin, m, mpp)
654fr_info_t *fin;
655mb_t *m, **mpp;
656{
265#ifdef USE_SPL
266 int s;
267#endif
268 if (fr_control_forwarding & 2)
269 V_ipforwarding = 0;
270
271 SPL_NET(s);
272

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

645 return fr_send_ip(fin, m, &m);
646}
647
648
649static int fr_send_ip(fin, m, mpp)
650fr_info_t *fin;
651mb_t *m, **mpp;
652{
657 INIT_VNET_INET(curvnet);
658 fr_info_t fnew;
659 ip_t *ip, *oip;
660 int hlen;
661
662 ip = mtod(m, ip_t *);
663 bzero((char *)&fnew, sizeof(fnew));
664
665 IP_V_A(ip, fin->fin_v);

--- 1005 unchanged lines hidden ---
653 fr_info_t fnew;
654 ip_t *ip, *oip;
655 int hlen;
656
657 ip = mtod(m, ip_t *);
658 bzero((char *)&fnew, sizeof(fnew));
659
660 IP_V_A(ip, fin->fin_v);

--- 1005 unchanged lines hidden ---