diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2003-10-10 15:26:41 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2003-10-10 15:26:41 +0000 |
commit | c7c38e279d4263a70d6be27625516210777ef25e (patch) | |
tree | b6ba2e57cb93ea912305f935feca832208f07d29 /sys/net | |
parent | 3ce258f126113b9d2a72d9ce795161e8ca0db389 (diff) |
make sure pd is initialized before use (or byte counters may increase
by random values). ok mcbride@, cedric@, henning@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index a78c78b7d02..b563dd7dda6 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.393 2003/10/02 05:47:30 itojun Exp $ */ +/* $OpenBSD: pf.c,v 1.394 2003/10/10 15:26:40 dhartmei Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -4739,6 +4739,7 @@ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0) panic("non-M_PKTHDR is passed to pf_test"); #endif + memset(&pd, 0, sizeof(pd)); if (m->m_pkthdr.len < (int)sizeof(*h)) { action = PF_DROP; REASON_SET(&reason, PFRES_SHORT); @@ -4762,7 +4763,6 @@ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0) goto done; } - memset(&pd, 0, sizeof(pd)); pd.src = (struct pf_addr *)&h->ip_src; pd.dst = (struct pf_addr *)&h->ip_dst; pd.ip_sum = &h->ip_sum; @@ -4981,6 +4981,7 @@ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0) panic("non-M_PKTHDR is passed to pf_test"); #endif + memset(&pd, 0, sizeof(pd)); if (m->m_pkthdr.len < (int)sizeof(*h)) { action = PF_DROP; REASON_SET(&reason, PFRES_SHORT); @@ -4996,7 +4997,6 @@ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0) m = *m0; h = mtod(m, struct ip6_hdr *); - memset(&pd, 0, sizeof(pd)); pd.src = (struct pf_addr *)&h->ip6_src; pd.dst = (struct pf_addr *)&h->ip6_dst; pd.ip_sum = NULL; |