fil.c (92685) | fil.c (95418) |
---|---|
1/* 2 * Copyright (C) 1993-2001 by Darren Reed. 3 * 4 * See the IPFILTER.LICENCE file for details on licencing. 5 */ 6#ifdef __sgi 7# include <sys/ptimers.h> 8#endif --- 85 unchanged lines hidden (view full) --- 94# define MIN(a,b) (((a)<(b))?(a):(b)) 95#endif 96#include "netinet/ipl.h" 97 98#include <machine/in_cksum.h> 99 100#if !defined(lint) 101static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed"; | 1/* 2 * Copyright (C) 1993-2001 by Darren Reed. 3 * 4 * See the IPFILTER.LICENCE file for details on licencing. 5 */ 6#ifdef __sgi 7# include <sys/ptimers.h> 8#endif --- 85 unchanged lines hidden (view full) --- 94# define MIN(a,b) (((a)<(b))?(a):(b)) 95#endif 96#include "netinet/ipl.h" 97 98#include <machine/in_cksum.h> 99 100#if !defined(lint) 101static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed"; |
102static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 92685 2002-03-19 11:44:16Z darrenr $"; | 102static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 95418 2002-04-25 03:31:39Z darrenr $"; |
103#endif 104 105#ifndef _KERNEL 106# include "ipf.h" 107# include "ipt.h" 108extern int opts; 109 110# define FR_VERBOSE(verb_pr) verbose verb_pr --- 97 unchanged lines hidden (view full) --- 208 209 fin->fin_rev = 0; 210 fin->fin_fr = NULL; 211 fin->fin_tcpf = 0; 212 fin->fin_data[0] = 0; 213 fin->fin_data[1] = 0; 214 fin->fin_rule = -1; 215 fin->fin_group = -1; | 103#endif 104 105#ifndef _KERNEL 106# include "ipf.h" 107# include "ipt.h" 108extern int opts; 109 110# define FR_VERBOSE(verb_pr) verbose verb_pr --- 97 unchanged lines hidden (view full) --- 208 209 fin->fin_rev = 0; 210 fin->fin_fr = NULL; 211 fin->fin_tcpf = 0; 212 fin->fin_data[0] = 0; 213 fin->fin_data[1] = 0; 214 fin->fin_rule = -1; 215 fin->fin_group = -1; |
216#ifdef _KERNEL | |
217 fin->fin_icode = ipl_unreach; | 216 fin->fin_icode = ipl_unreach; |
218#endif | |
219 v = fin->fin_v; 220 fi->fi_v = v; 221 fin->fin_hlen = hlen; 222 if (v == 4) { 223 fin->fin_id = ip->ip_id; 224 fi->fi_tos = ip->ip_tos; 225 off = (ip->ip_off & IP_OFFMASK); 226 tcp = (tcphdr_t *)((char *)ip + hlen); --- 33 unchanged lines hidden (view full) --- 260 } 261#endif 262 else 263 return; 264 265 fin->fin_off = off; 266 fin->fin_plen = plen; 267 fin->fin_dp = (char *)tcp; | 217 v = fin->fin_v; 218 fi->fi_v = v; 219 fin->fin_hlen = hlen; 220 if (v == 4) { 221 fin->fin_id = ip->ip_id; 222 fi->fi_tos = ip->ip_tos; 223 off = (ip->ip_off & IP_OFFMASK); 224 tcp = (tcphdr_t *)((char *)ip + hlen); --- 33 unchanged lines hidden (view full) --- 258 } 259#endif 260 else 261 return; 262 263 fin->fin_off = off; 264 fin->fin_plen = plen; 265 fin->fin_dp = (char *)tcp; |
266 fin->fin_misc = 0; |
|
268 off <<= 3; 269 270 switch (p) 271 { 272#ifdef USE_INET6 273 case IPPROTO_ICMPV6 : 274 { 275 int minicmpsz = sizeof(struct icmp6_hdr); --- 16 unchanged lines hidden (view full) --- 292 case ICMP6_PARAM_PROB : 293 minicmpsz = ICMP6ERR_IPICMPHLEN; 294 break; 295 default : 296 break; 297 } 298 } 299 | 267 off <<= 3; 268 269 switch (p) 270 { 271#ifdef USE_INET6 272 case IPPROTO_ICMPV6 : 273 { 274 int minicmpsz = sizeof(struct icmp6_hdr); --- 16 unchanged lines hidden (view full) --- 291 case ICMP6_PARAM_PROB : 292 minicmpsz = ICMP6ERR_IPICMPHLEN; 293 break; 294 default : 295 break; 296 } 297 } 298 |
300 if (!(plen >= hlen + minicmpsz)) | 299 if (!(plen >= minicmpsz)) |
301 fi->fi_fl |= FI_SHORT; 302 303 break; 304 } 305#endif 306 case IPPROTO_ICMP : 307 { 308 int minicmpsz = sizeof(struct icmp); --- 1198 unchanged lines hidden (view full) --- 1507 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1508 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1509 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1510 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1511 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1512 * SUCH DAMAGE. 1513 * 1514 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 | 300 fi->fi_fl |= FI_SHORT; 301 302 break; 303 } 304#endif 305 case IPPROTO_ICMP : 306 { 307 int minicmpsz = sizeof(struct icmp); --- 1198 unchanged lines hidden (view full) --- 1506 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1507 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1508 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1509 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1510 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1511 * SUCH DAMAGE. 1512 * 1513 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 |
1515 * $Id: fil.c,v 2.35.2.58 2002/03/13 02:23:13 darrenr Exp $ | 1514 * $Id: fil.c,v 2.35.2.59 2002/03/25 11:07:37 darrenr Exp $ |
1516 */ 1517/* 1518 * Copy data from an mbuf chain starting "off" bytes from the beginning, 1519 * continuing for "len" bytes, into the indicated buffer. 1520 */ 1521void 1522m_copydata(m, off, len, cp) 1523 register mb_t *m; --- 656 unchanged lines hidden --- | 1515 */ 1516/* 1517 * Copy data from an mbuf chain starting "off" bytes from the beginning, 1518 * continuing for "len" bytes, into the indicated buffer. 1519 */ 1520void 1521m_copydata(m, off, len, cp) 1522 register mb_t *m; --- 656 unchanged lines hidden --- |