summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2016-10-18 11:29:28 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2016-10-18 11:29:28 +0000
commit6e907c67af158952eff91962f88facffb732e132 (patch)
treedae2d70cdf18565eba42de03bd8e0d8c4e5ad047
parentc0edf1d09650bff29054261f1bad27931590c156 (diff)
The variable dlen is always positive and d may be negative. So
declare both with the correct sign in pf_change_icmp_af(). OK henning@
-rw-r--r--sys/net/pf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index aa7b9f33b8a..d3b313c1305 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.990 2016/10/18 11:20:42 bluhm Exp $ */
+/* $OpenBSD: pf.c,v 1.991 2016/10/18 11:29:27 bluhm Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -2340,7 +2340,8 @@ pf_change_icmp_af(struct mbuf *m, int ipoff2, struct pf_pdesc *pd,
struct mbuf *n = NULL;
struct ip *ip4;
struct ip6_hdr *ip6;
- u_int hlen, ohlen, d;
+ u_int hlen, ohlen, dlen;
+ int d;
if (af == naf || (af != AF_INET && af != AF_INET6) ||
(naf != AF_INET && naf != AF_INET6))
@@ -2417,7 +2418,7 @@ pf_change_icmp_af(struct mbuf *m, int ipoff2, struct pf_pdesc *pd,
if (pd->proto == IPPROTO_ICMPV6) {
/* fixup pseudo-header */
- int dlen = pd->tot_len - pd->off;
+ dlen = pd->tot_len - pd->off;
pf_cksum_fixup(pd->pcksum,
htons(dlen), htons(dlen + d), pd->proto);
}