summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2013-06-04 19:03:13 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2013-06-04 19:03:13 +0000
commitbaaaf98da60f3ff53a511f3ebf0725e2092010b6 (patch)
treec2db9d040a82cf947e3bd60531907ea3617eb116 /sys
parent020fe6face6b46e12c930196fd3a2adb2bdfbed7 (diff)
add a pointer to the protocol checksum header field to pf_pdesc and set
it up in pf_setup_pdesc(). ok ryan benno mikeb bluhm
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf.c5
-rw-r--r--sys/net/pfvar.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index dce0faeee34..c2c690dc674 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.831 2013/06/04 18:58:28 henning Exp $ */
+/* $OpenBSD: pf.c,v 1.832 2013/06/04 19:03:11 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -6565,6 +6565,7 @@ pf_setup_pdesc(struct pf_pdesc *pd, void *pdhdrs, sa_family_t af, int dir,
pd->p_len = pd->tot_len - pd->off - (th->th_off << 2);
pd->sport = &th->th_sport;
pd->dport = &th->th_dport;
+ pd->pcksum = &th->th_sum;
break;
}
case IPPROTO_UDP: {
@@ -6582,6 +6583,7 @@ pf_setup_pdesc(struct pf_pdesc *pd, void *pdhdrs, sa_family_t af, int dir,
}
pd->sport = &uh->uh_sport;
pd->dport = &uh->uh_dport;
+ pd->pcksum = &uh->uh_sum;
break;
}
case IPPROTO_ICMP: {
@@ -6593,6 +6595,7 @@ pf_setup_pdesc(struct pf_pdesc *pd, void *pdhdrs, sa_family_t af, int dir,
REASON_SET(reason, PFRES_SHORT);
return (PF_DROP);
}
+ pd->pcksum = &pd->hdr.icmp->icmp_cksum;
break;
}
#ifdef INET6
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index fa82ba08153..c84634b1001 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfvar.h,v 1.382 2013/06/03 15:00:00 henning Exp $ */
+/* $OpenBSD: pfvar.h,v 1.383 2013/06/04 19:03:12 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1245,6 +1245,7 @@ struct pf_pdesc {
*eh;
struct pf_addr *src; /* src address */
struct pf_addr *dst; /* dst address */
+ u_int16_t *pcksum; /* proto cksum */
u_int16_t *sport;
u_int16_t *dport;
u_int16_t osport;