summaryrefslogtreecommitdiff
path: root/sys/net/pf_norm.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2011-07-03 18:08:03 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2011-07-03 18:08:03 +0000
commit290bab090bc67572eb2bf028c29cce8ad9b3a4cf (patch)
tree74ab9220dd3a3c8d9b93504c1229511ac469d1fc /sys/net/pf_norm.c
parent5e8956aa7b03d707c09eaa06052aa50d1bee50fb (diff)
Refactor the fragment handling in pf_setup_pdesc() so that AF_INET
and AF_INET6 are doing the fragment handling the same way. Makes code more readable. With and OK bluhm@
Diffstat (limited to 'sys/net/pf_norm.c')
-rw-r--r--sys/net/pf_norm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c
index 61761f0f37b..6d42f096422 100644
--- a/sys/net/pf_norm.c
+++ b/sys/net/pf_norm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_norm.c,v 1.135 2011/06/21 08:59:47 bluhm Exp $ */
+/* $OpenBSD: pf_norm.c,v 1.136 2011/07/03 18:08:02 claudio Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@@ -764,6 +764,9 @@ pf_normalize_ip(struct mbuf **m0, int dir, u_short *reason)
return (PF_DROP);
}
+ if (!pf_status.reass)
+ return (PF_PASS); /* no reassembly */
+
/* Returns PF_DROP or *m0 is NULL or completely reassembled mbuf */
if (pf_reassemble(m0, h, dir, reason) != PF_PASS)
return (PF_DROP);
@@ -896,6 +899,9 @@ pf_normalize_ip6(struct mbuf **m0, int dir, u_short *reason)
if (sizeof(struct ip6_hdr) + plen > m->m_pkthdr.len)
goto shortpkt;
+ if (!pf_status.reass)
+ return (PF_PASS); /* no reassembly */
+
if (!pf_pull_hdr(m, off, &frag, sizeof(frag), NULL, NULL, AF_INET6))
goto shortpkt;
/* offset now points to data portion */