Deleted Added
full compact
fil.c (196019) fil.c (241245)
1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 196019 2009-08-01 19:26:27Z rwatson $ */
1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 241245 2012-10-06 10:02:11Z glebius $ */
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(KERNEL) || defined(_KERNEL)
9# undef KERNEL

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

150#endif
151#include "netinet/ipl.h"
152/* END OF INCLUDES */
153
154#include <machine/in_cksum.h>
155
156#if !defined(lint)
157static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed";
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(KERNEL) || defined(_KERNEL)
9# undef KERNEL

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

150#endif
151#include "netinet/ipl.h"
152/* END OF INCLUDES */
153
154#include <machine/in_cksum.h>
155
156#if !defined(lint)
157static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed";
158static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 196019 2009-08-01 19:26:27Z rwatson $";
158static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 241245 2012-10-06 10:02:11Z glebius $";
159/* static const char rcsid[] = "@(#)$Id: fil.c,v 2.243.2.125 2007/10/10 09:27:20 darrenr Exp $"; */
160#endif
161
162#ifndef _KERNEL
163# include "ipf.h"
164# include "ipt.h"
165# include "bpf-ipf.h"
166extern int opts;

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

2508 */
2509 if (((ip6_t *)ip)->ip6_plen == 0) {
2510 pass = FR_BLOCK|FR_NOMATCH;
2511 goto finished;
2512 }
2513 } else
2514#endif
2515 {
159/* static const char rcsid[] = "@(#)$Id: fil.c,v 2.243.2.125 2007/10/10 09:27:20 darrenr Exp $"; */
160#endif
161
162#ifndef _KERNEL
163# include "ipf.h"
164# include "ipt.h"
165# include "bpf-ipf.h"
166extern int opts;

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

2508 */
2509 if (((ip6_t *)ip)->ip6_plen == 0) {
2510 pass = FR_BLOCK|FR_NOMATCH;
2511 goto finished;
2512 }
2513 } else
2514#endif
2515 {
2516#if (defined(OpenBSD) && (OpenBSD >= 200311)) && defined(_KERNEL)
2516#if ((defined(OpenBSD) && (OpenBSD >= 200311)) || (defined(FreeBSD) && (__FreeBSD_version >= 1000019))) && defined(_KERNEL)
2517 ip->ip_len = ntohs(ip->ip_len);
2518 ip->ip_off = ntohs(ip->ip_off);
2519#endif
2520 }
2521
2522 if (fr_makefrip(hlen, ip, fin) == -1) {
2523 pass = FR_BLOCK|FR_NOMATCH;
2524 goto finished;

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

2772 }
2773#endif
2774 }
2775
2776 SPL_X(s);
2777 RWLOCK_EXIT(&ipf_global);
2778
2779#ifdef _KERNEL
2517 ip->ip_len = ntohs(ip->ip_len);
2518 ip->ip_off = ntohs(ip->ip_off);
2519#endif
2520 }
2521
2522 if (fr_makefrip(hlen, ip, fin) == -1) {
2523 pass = FR_BLOCK|FR_NOMATCH;
2524 goto finished;

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

2772 }
2773#endif
2774 }
2775
2776 SPL_X(s);
2777 RWLOCK_EXIT(&ipf_global);
2778
2779#ifdef _KERNEL
2780# if (defined(OpenBSD) && (OpenBSD >= 200311))
2780# if (defined(OpenBSD) && (OpenBSD >= 200311)) || (defined(FreeBSD) && (__FreeBSD_version >= 1000019))
2781 if (FR_ISPASS(pass) && (v == 4)) {
2782 ip = fin->fin_ip;
2783 ip->ip_len = ntohs(ip->ip_len);
2784 ip->ip_off = ntohs(ip->ip_off);
2785 }
2786# endif
2787 return (FR_ISPASS(pass)) ? 0 : fin->fin_error;
2788#else /* _KERNEL */

--- 4570 unchanged lines hidden ---
2781 if (FR_ISPASS(pass) && (v == 4)) {
2782 ip = fin->fin_ip;
2783 ip->ip_len = ntohs(ip->ip_len);
2784 ip->ip_off = ntohs(ip->ip_off);
2785 }
2786# endif
2787 return (FR_ISPASS(pass)) ? 0 : fin->fin_error;
2788#else /* _KERNEL */

--- 4570 unchanged lines hidden ---