Deleted Added
full compact
2c2
< * Copyright (C) 1993-2000 by Darren Reed.
---
> * Copyright (C) 1993-2001 by Darren Reed.
4,6c4
< * Redistribution and use in source and binary forms are permitted
< * provided that this notice is preserved and due credit is given
< * to the original author and the contributors.
---
> * See the IPFILTER.LICENCE file for details on licencing.
8,13d5
< #if !defined(lint)
< static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed";
< /* static const char rcsid[] = "@(#)$Id: fil.c,v 2.3.2.16 2000/01/27 08:49:37 darrenr Exp $"; */
< static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 72006 2001-02-04 14:26:56Z darrenr $";
< #endif
<
105a98,103
> #if !defined(lint)
> static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed";
> /* static const char rcsid[] = "@(#)$Id: fil.c,v 2.35.2.39 2001/07/18 13:30:32 darrenr Exp $"; */
> static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/fil.c 80482 2001-07-28 11:58:26Z darrenr $";
> #endif
>
121,126d118
< # endif
< # if SOLARIS
< # define FR_NEWAUTH(m, fi, ip, qif) fr_newauth((mb_t *)m, fi, \
< ip, qif)
< # else /* SOLARIS */
< # define FR_NEWAUTH(m, fi, ip, qif) fr_newauth((mb_t *)m, fi, ip)
232c224
< off = (ip->ip_off & IP_OFFMASK) << 3;
---
> off = (ip->ip_off & IP_OFFMASK);
245c237
< if (ip->ip_off & 0x3fff)
---
> if (ip->ip_off & (IP_MF|IP_OFFMASK))
265a258
> plen += sizeof(*ip6);
273a267
> off <<= 3;
321,322c315,321
< if (icmp->icmp_type == ICMP_ECHOREPLY ||
< icmp->icmp_type == ICMP_ECHO)
---
> switch (icmp->icmp_type)
> {
> case ICMP_ECHOREPLY :
> case ICMP_ECHO :
> /* Router discovery messages - RFC 1256 */
> case ICMP_ROUTERADVERT :
> case ICMP_ROUTERSOLICIT :
324c323
<
---
> break;
329,330c328,329
< else if (icmp->icmp_type == ICMP_TSTAMP ||
< icmp->icmp_type == ICMP_TSTAMPREPLY)
---
> case ICMP_TSTAMP :
> case ICMP_TSTAMPREPLY :
332c331
<
---
> break;
337,338c336,337
< else if (icmp->icmp_type == ICMP_MASKREQ ||
< icmp->icmp_type == ICMP_MASKREPLY)
---
> case ICMP_MASKREQ :
> case ICMP_MASKREPLY :
339a339,342
> break;
> default :
> break;
> }
528c531
< if (fin->fin_fi.fi_fl & FI_SHORT)
---
> if (fin->fin_fl & FI_SHORT)
563,566c566
< if (fin->fin_v == 4)
< off = ip->ip_off & IP_OFFMASK;
< else
< off = 0;
---
> off = fin->fin_off;
793c793
< char hbuf[(0xf << 2) + sizeof(struct icmp) + sizeof(ip_t) + 8];
---
> char hbuf[128];
817a818,820
> if (!len)
> return -1; /* potential jumbo gram */
> len += sizeof(ip6_t);
826c829,830
< if ((p == IPPROTO_TCP || p == IPPROTO_UDP || p == IPPROTO_ICMP
---
> if ((p == IPPROTO_TCP || p == IPPROTO_UDP ||
> (v == 4 && p == IPPROTO_ICMP)
948c952
< if (fin->fin_fi.fi_fl & FI_SHORT) {
---
> if (fin->fin_fl & FI_SHORT) {
954,956d957
< if (fin->fin_fi.fi_fl & FI_SHORT)
< ATOMIC_INCL(frstats[out].fr_short);
<
980,981c981,992
< if (apass || (!(fr = ipfr_knownfrag(ip, fin)) &&
< !(fr = fr_checkstate(ip, fin)))) {
---
> if (!apass) {
> if ((fin->fin_fl & FI_FRAG) == FI_FRAG)
> fr = ipfr_knownfrag(ip, fin);
> if (!fr && !(fin->fin_fl & FI_SHORT))
> fr = fr_checkstate(ip, fin);
> if (fr != NULL)
> pass = fr->fr_flags;
> if (fr && (pass & FR_LOGFIRST))
> pass &= ~(FR_LOGFIRST|FR_LOG);
> }
>
> if (apass || !fr) {
1016d1026
< fr = fin->fin_fr;
1018a1029
> fr = fin->fin_fr;
1025,1026c1036,1037
< if ((pass & FR_AUTH))
< if (fr_newauth((mb_t *)m, fin, ip) != 0)
---
> if ((pass & FR_AUTH)) {
> if (fr_newauth((mb_t *)m, fin, ip) != 0) {
1031a1043,1046
> error = 0;
> } else
> error = ENOSPC;
> }
1046c1061
< if (fin->fin_fi.fi_fl & FI_FRAG) {
---
> if (fin->fin_fl & FI_FRAG) {
1170c1185
< !(fin->fin_fi.fi_fl & FI_SHORT)) {
---
> !(fin->fin_fl & FI_SHORT)) {
1183c1198
< !(fin->fin_fi.fi_fl & FI_SHORT)) {
---
> !(fin->fin_fl & FI_SHORT)) {
1212,1217c1227,1231
< (fdp->fd_ifp && fdp->fd_ifp != (struct ifnet *)-1)) {
< if (ipfr_fastroute(m, fin, fdp) == 0)
< m = *mp = NULL;
< }
< if (mc)
< ipfr_fastroute(mc, fin, &fr->fr_dif);
---
> (fdp->fd_ifp && fdp->fd_ifp != (struct ifnet *)-1))
> (void) ipfr_fastroute(m, mp, fin, fdp);
>
> if (mc != NULL)
> (void) ipfr_fastroute(mc, &mc, fin, &fr->fr_dif);
1219c1233,1234
< if (!(pass & FR_PASS) && m)
---
>
> if (!(pass & FR_PASS) && m) {
1220a1236,1237
> m = *mp = NULL;
> }
1231,1236c1248,1252
< (fdp->fd_ifp && fdp->fd_ifp != (struct ifnet *)-1)) {
< if (ipfr_fastroute(ip, m, mp, fin, fdp) == 0)
< m = *mp = NULL;
< }
< if (mc)
< ipfr_fastroute(ip, mc, mp, fin, &fr->fr_dif);
---
> (fdp->fd_ifp && fdp->fd_ifp != (struct ifnet *)-1))
> (void) ipfr_fastroute(ip, m, mp, fin, fdp);
>
> if (mc != NULL)
> (void) ipfr_fastroute(ip, mc, &mc, fin, &fr->fr_dif);
1468c1484
< * $Id: fil.c,v 2.35.2.30 2000/12/17 05:49:22 darrenr Exp $
---
> * $Id: fil.c,v 2.35.2.39 2001/07/18 13:30:32 darrenr Exp $
1917c1933
< # endif
---
> # endif /* !SOLARIS */