summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-07-12 09:33:33 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-07-12 09:33:33 +0000
commitebd8a79eb0d1af82407612bec2f3edd48ba3e579 (patch)
treee38e32a7e90e972cdb849762732454f1fd5355d3 /sys
parent71592d940dc3cc0a31be00887e3c300c2357b10b (diff)
Prevent u_int16_t variable from overflowing and get rid of the compiler
warning. From Pyun YongHyeon. ok itojun@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf_norm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c
index 5186df972c6..d9418fc2e54 100644
--- a/sys/net/pf_norm.c
+++ b/sys/net/pf_norm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_norm.c,v 1.68 2003/07/10 05:50:10 itojun Exp $ */
+/* $OpenBSD: pf_norm.c,v 1.69 2003/07/12 09:33:32 dhartmei Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@@ -871,12 +871,12 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct ifnet *ifp, u_short *reason)
goto bad;
}
- max = fragoff + ip_len;
/* Respect maximum length */
- if (max > IP_MAXPACKET) {
- DPFPRINTF(("max packet %d\n", max));
+ if (fragoff + ip_len > IP_MAXPACKET) {
+ DPFPRINTF(("max packet %d\n", fragoff + ip_len));
goto bad;
}
+ max = fragoff + ip_len;
if ((r->rule_flag & (PFRULE_FRAGCROP|PFRULE_FRAGDROP)) == 0) {
/* Fully buffer all of the fragments */