summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>2000-10-29 08:08:32 +0000
committerdarrenr <darrenr@FreeBSD.org>2000-10-29 08:08:32 +0000
commit5d70b50283c03b9bc544b145bcd928d0d32da57c (patch)
tree0bbb1ffd7a750945216fe84f227e0585717be05a /contrib
parent9b0fb03ebcfb1c076d65c37bc19534212c7cf4a4 (diff)
downloadFreeBSD-src-5d70b50283c03b9bc544b145bcd928d0d32da57c.zip
FreeBSD-src-5d70b50283c03b9bc544b145bcd928d0d32da57c.tar.gz
fix conflicts created by import
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ipfilter/fil.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/contrib/ipfilter/fil.c b/contrib/ipfilter/fil.c
index bdb3d2f..9accee8 100644
--- a/contrib/ipfilter/fil.c
+++ b/contrib/ipfilter/fil.c
@@ -274,32 +274,35 @@ fr_info_t *fin;
int minicmpsz = sizeof(struct icmp);
icmphdr_t *icmp;
- if (fin->fin_dlen > 1)
+ if (!off && (fin->fin_dlen > 1)) {
fin->fin_data[0] = *(u_short *)tcp;
- if ((!(plen >= hlen + minicmpsz) && !off) ||
- (off && off < sizeof(struct icmp))) {
- fi->fi_fl |= FI_SHORT;
- if (fin->fin_dlen < 2)
- break;
- }
+ icmp = (icmphdr_t *)tcp;
- icmp = (icmphdr_t *)tcp;
+ if (icmp->icmp_type == ICMP_ECHOREPLY ||
+ icmp->icmp_type == ICMP_ECHO)
+ minicmpsz = ICMP_MINLEN;
- if (!off && (icmp->icmp_type == ICMP_ECHOREPLY ||
- icmp->icmp_type == ICMP_ECHO))
- minicmpsz = ICMP_MINLEN;
+ /*
+ * type(1) + code(1) + cksum(2) + id(2) seq(2) +
+ * 3*timestamp(3*4)
+ */
+ else if (icmp->icmp_type == ICMP_TSTAMP ||
+ icmp->icmp_type == ICMP_TSTAMPREPLY)
+ minicmpsz = 20;
- /* type(1) + code(1) + cksum(2) + id(2) seq(2) +
- * 3*timestamp(3*4) */
- else if (!off && (icmp->icmp_type == ICMP_TSTAMP ||
- icmp->icmp_type == ICMP_TSTAMPREPLY))
- minicmpsz = 20;
+ /*
+ * type(1) + code(1) + cksum(2) + id(2) seq(2) +
+ * mask(4)
+ */
+ else if (icmp->icmp_type == ICMP_MASKREQ ||
+ icmp->icmp_type == ICMP_MASKREPLY)
+ minicmpsz = 12;
+ }
- /* type(1) + code(1) + cksum(2) + id(2) seq(2) + mask(4) */
- else if (!off && (icmp->icmp_type == ICMP_MASKREQ ||
- icmp->icmp_type == ICMP_MASKREPLY))
- minicmpsz = 12;
+ if ((!(plen >= hlen + minicmpsz) && !off) ||
+ (off && off < sizeof(struct icmp)))
+ fi->fi_fl |= FI_SHORT;
break;
}
@@ -1398,7 +1401,7 @@ nodata:
* SUCH DAMAGE.
*
* @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * $Id: fil.c,v 2.35.2.26 2000/10/24 11:58:17 darrenr Exp $
+ * $Id: fil.c,v 2.35.2.27 2000/10/26 21:20:54 darrenr Exp $
*/
/*
* Copy data from an mbuf chain starting "off" bytes from the beginning,
OpenPOWER on IntegriCloud