diff options
author | 2013-10-22 15:35:57 +0000 | |
---|---|---|
committer | 2013-10-22 15:35:57 +0000 | |
commit | a1b9f9037ac5ecb0e4c4342fe411cccc99c2ff05 (patch) | |
tree | b2042524ef978e9b8b663068d410c7e07f7d1682 | |
parent | Some current boards do not have write-through caching. For those, (diff) | |
download | wireguard-openbsd-a1b9f9037ac5ecb0e4c4342fe411cccc99c2ff05.tar.xz wireguard-openbsd-a1b9f9037ac5ecb0e4c4342fe411cccc99c2ff05.zip |
In pf_test_state_icmp(), actually copy pd->hdr.any back into the mbuf as
intended after the ICMP/ICMPv6 checksum is zeroed in pf_cksum(). This
resolves an issue found by sthen@ where ICMP traffic with nat-to failed
due to incorrect checksums.
Fix tested by sthen@ and myself
OK henning@
-rw-r--r-- | sys/net/pf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index c440a485bde..9c5ca4257c9 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.849 2013/10/21 09:39:23 henning Exp $ */ +/* $OpenBSD: pf.c,v 1.850 2013/10/22 15:35:57 lteo Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -5325,8 +5325,10 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state, } } } - if (copyback) + if (copyback) { pf_cksum(pd, pd->m); + m_copyback(pd->m, pd->off, pd->hdrlen, pd->hdr.any, M_NOWAIT); + } return (PF_PASS); } |