Deleted Added
full compact
fil.c (108172) fil.c (109623)
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 108172 2002-12-22 05:35:03Z hsu $";
102static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 109623 2003-01-21 08:56:16Z alfred $";
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

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

1183 * set FR_DUP as a "default" as there are no instructions about where
1184 * to send the packet.
1185 */
1186 if (fr && (pass & FR_DUP))
1187# if SOLARIS
1188 mc = dupmsg(m);
1189# else
1190# if defined(__OpenBSD__) && (OpenBSD >= 199905)
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

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

1183 * set FR_DUP as a "default" as there are no instructions about where
1184 * to send the packet.
1185 */
1186 if (fr && (pass & FR_DUP))
1187# if SOLARIS
1188 mc = dupmsg(m);
1189# else
1190# if defined(__OpenBSD__) && (OpenBSD >= 199905)
1191 mc = m_copym2(m, 0, M_COPYALL, M_DONTWAIT);
1191 mc = m_copym2(m, 0, M_COPYALL, M_NOWAIT);
1192# else
1193 mc = m_copy(m, 0, M_COPYALL);
1194# endif
1195# endif
1196#endif
1197 if (pass & FR_PASS) {
1198 ATOMIC_INCL(frstats[out].fr_pass);
1199 } else if (pass & FR_BLOCK) {

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

1582 int totlen = 0;
1583
1584 if (m0 == 0)
1585 return;
1586 while (off > (mlen = m->m_len)) {
1587 off -= mlen;
1588 totlen += mlen;
1589 if (m->m_next == 0) {
1192# else
1193 mc = m_copy(m, 0, M_COPYALL);
1194# endif
1195# endif
1196#endif
1197 if (pass & FR_PASS) {
1198 ATOMIC_INCL(frstats[out].fr_pass);
1199 } else if (pass & FR_BLOCK) {

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

1582 int totlen = 0;
1583
1584 if (m0 == 0)
1585 return;
1586 while (off > (mlen = m->m_len)) {
1587 off -= mlen;
1588 totlen += mlen;
1589 if (m->m_next == 0) {
1590 n = m_getclr(M_DONTWAIT, m->m_type);
1590 n = m_getclr(M_NOWAIT, m->m_type);
1591 if (n == 0)
1592 goto out;
1593 n->m_len = min(MLEN, len + off);
1594 m->m_next = n;
1595 }
1596 m = m->m_next;
1597 }
1598 while (len > 0) {
1599 mlen = min (m->m_len - off, len);
1600 bcopy(cp, off + mtod(m, caddr_t), (unsigned)mlen);
1601 cp += mlen;
1602 len -= mlen;
1603 mlen += off;
1604 off = 0;
1605 totlen += mlen;
1606 if (len == 0)
1607 break;
1608 if (m->m_next == 0) {
1591 if (n == 0)
1592 goto out;
1593 n->m_len = min(MLEN, len + off);
1594 m->m_next = n;
1595 }
1596 m = m->m_next;
1597 }
1598 while (len > 0) {
1599 mlen = min (m->m_len - off, len);
1600 bcopy(cp, off + mtod(m, caddr_t), (unsigned)mlen);
1601 cp += mlen;
1602 len -= mlen;
1603 mlen += off;
1604 off = 0;
1605 totlen += mlen;
1606 if (len == 0)
1607 break;
1608 if (m->m_next == 0) {
1609 n = m_get(M_DONTWAIT, m->m_type);
1609 n = m_get(M_NOWAIT, m->m_type);
1610 if (n == 0)
1611 break;
1612 n->m_len = min(MLEN, len);
1613 m->m_next = n;
1614 }
1615 m = m->m_next;
1616 }
1617out:

--- 593 unchanged lines hidden ---
1610 if (n == 0)
1611 break;
1612 n->m_len = min(MLEN, len);
1613 m->m_next = n;
1614 }
1615 m = m->m_next;
1616 }
1617out:

--- 593 unchanged lines hidden ---