Deleted Added
full compact
fil.c (147547) fil.c (153084)
1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 147547 2005-06-23 14:19:02Z darrenr $ */
1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 153084 2005-12-04 10:06:06Z ru $ */
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

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

131#endif
132#include "netinet/ipl.h"
133/* END OF INCLUDES */
134
135#include <machine/in_cksum.h>
136
137#if !defined(lint)
138static 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

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

131#endif
132#include "netinet/ipl.h"
133/* END OF INCLUDES */
134
135#include <machine/in_cksum.h>
136
137#if !defined(lint)
138static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed";
139static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 147547 2005-06-23 14:19:02Z darrenr $";
139static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 153084 2005-12-04 10:06:06Z ru $";
140/* static const char rcsid[] = "@(#)Id: fil.c,v 2.243.2.57 2005/03/28 10:47:50 darrenr Exp"; */
141#endif
142
143#ifndef _KERNEL
144# include "ipf.h"
145# include "ipt.h"
146# include "bpf-ipf.h"
147extern int opts;

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

2282 if (fin->fin_plen == 0) {
2283 pass = FR_BLOCK|FR_NOMATCH;
2284 goto filtered;
2285 }
2286 fin->fin_plen += sizeof(ip6_t);
2287 } else
2288#endif
2289 {
140/* static const char rcsid[] = "@(#)Id: fil.c,v 2.243.2.57 2005/03/28 10:47:50 darrenr Exp"; */
141#endif
142
143#ifndef _KERNEL
144# include "ipf.h"
145# include "ipt.h"
146# include "bpf-ipf.h"
147extern int opts;

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

2282 if (fin->fin_plen == 0) {
2283 pass = FR_BLOCK|FR_NOMATCH;
2284 goto filtered;
2285 }
2286 fin->fin_plen += sizeof(ip6_t);
2287 } else
2288#endif
2289 {
2290#if (OpenBSD >= 200311) && defined(_KERNEL)
2290#if (defined(OpenBSD) && OpenBSD >= 200311) && defined(_KERNEL)
2291 ip->ip_len = ntohs(ip->ip_len);
2292 ip->ip_off = ntohs(ip->ip_off);
2293#endif
2294 fin->fin_plen = ip->ip_len;
2295 }
2296
2297 if (fr_makefrip(hlen, ip, fin) == -1)
2298 goto finished;

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

2494 (mtod(fin->fin_m, struct ip *) != fin->fin_ip)) {
2495 COPYBACK(m, 0, fin->fin_plen, fin->fin_hbuf);
2496 }
2497#endif
2498 }
2499
2500 RWLOCK_EXIT(&ipf_global);
2501#ifdef _KERNEL
2291 ip->ip_len = ntohs(ip->ip_len);
2292 ip->ip_off = ntohs(ip->ip_off);
2293#endif
2294 fin->fin_plen = ip->ip_len;
2295 }
2296
2297 if (fr_makefrip(hlen, ip, fin) == -1)
2298 goto finished;

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

2494 (mtod(fin->fin_m, struct ip *) != fin->fin_ip)) {
2495 COPYBACK(m, 0, fin->fin_plen, fin->fin_hbuf);
2496 }
2497#endif
2498 }
2499
2500 RWLOCK_EXIT(&ipf_global);
2501#ifdef _KERNEL
2502# if OpenBSD >= 200311
2502# if defined(OpenBSD) && OpenBSD >= 200311
2503 if (FR_ISPASS(pass) && (v == 4)) {
2504 ip = fin->fin_ip;
2505 ip->ip_len = ntohs(ip->ip_len);
2506 ip->ip_off = ntohs(ip->ip_off);
2507 }
2508# endif
2509 return (FR_ISPASS(pass)) ? 0 : fin->fin_error;
2510#else /* _KERNEL */

--- 3739 unchanged lines hidden ---
2503 if (FR_ISPASS(pass) && (v == 4)) {
2504 ip = fin->fin_ip;
2505 ip->ip_len = ntohs(ip->ip_len);
2506 ip->ip_off = ntohs(ip->ip_off);
2507 }
2508# endif
2509 return (FR_ISPASS(pass)) ? 0 : fin->fin_error;
2510#else /* _KERNEL */

--- 3739 unchanged lines hidden ---