summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authoralex <alex@FreeBSD.org>1998-01-05 00:08:57 +0000
committeralex <alex@FreeBSD.org>1998-01-05 00:08:57 +0000
commit147e6a553f204d1b1231faaf9b5f7c1e3f1ad1da (patch)
treec46e07fe305206129c5a8a515ead86fa6faacad7 /sys/netinet
parent44f7a5e2007f5b380ee895ff9c5050b692521544 (diff)
downloadFreeBSD-src-147e6a553f204d1b1231faaf9b5f7c1e3f1ad1da.zip
FreeBSD-src-147e6a553f204d1b1231faaf9b5f7c1e3f1ad1da.tar.gz
Bound the ICMP type bitmap now that it doesn't cover all possible
ICMP type values.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_fw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index 1a4523d..1ae0fab 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -12,7 +12,7 @@
*
* This software is provided ``AS IS'' without any warranties of any kind.
*
- * $Id: ip_fw.c,v 1.67 1997/12/27 18:44:56 alex Exp $
+ * $Id: ip_fw.c,v 1.68 1998/01/04 22:36:12 alex Exp $
*/
/*
@@ -154,7 +154,8 @@ icmptype_match(struct icmp *icmp, struct ip_fw *f)
type = icmp->icmp_type;
/* check for matching type in the bitmap */
- if (f->fw_icmptypes[type / (sizeof(unsigned) * 8)] &
+ if (type < IP_FW_ICMPTYPES_DIM * sizeof(unsigned) * 8 &&
+ f->fw_icmptypes[type / (sizeof(unsigned) * 8)] &
(1U << (type % (8 * sizeof(unsigned)))))
return(1);
OpenPOWER on IntegriCloud