diff options
author | 2013-06-04 19:03:11 +0000 | |
---|---|---|
committer | 2013-06-04 19:03:11 +0000 | |
commit | 14255d4d8762c5a4d6ee3f1765f33cdcf55becdf (patch) | |
tree | 22dff9e514d026e38b297e9fe055a55c5cadb6aa | |
parent | classify_integer(): test whether the value can be built using the `set' (diff) | |
download | wireguard-openbsd-14255d4d8762c5a4d6ee3f1765f33cdcf55becdf.tar.xz wireguard-openbsd-14255d4d8762c5a4d6ee3f1765f33cdcf55becdf.zip |
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
-rw-r--r-- | sys/net/pf.c | 5 | ||||
-rw-r--r-- | sys/net/pfvar.h | 3 |
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; |