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 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; |
216 fin->fin_icode = ipl_unreach; |
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; |
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 |
299 if (!(plen >= minicmpsz)) |
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 |
1514 * $Id: fil.c,v 2.35.2.59 2002/03/25 11:07:37 darrenr Exp $ |
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 --- |