diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2020-07-30 03:30:05 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2020-07-30 03:30:05 +0000 |
commit | 14d4bd8b5cc93928037ccc62dcebd7c13ecf849e (patch) | |
tree | c0dbee739154db4f318be1695dc4cfc7d7b26c6a /share/mk | |
parent | 01cf4a0c148d60048b2957e8f1e52872fbc9a120 (diff) |
make pflog more mpsafe with variables on the stack instead of globals.
pflog wants to copy and patch the packet that is being logged to
properly show if it is being transformed, and it does this by copying
the ip and transport headers into a local mbuf and patching them
there, and then wiring the remaining data from the original packet
into an mbuf chain hanging off this patched mbuf.
it's just unfortunate that the mbufs it was using are global and
not locked. this is particularly unfortunate if you're running the
stack in parallel on multiple cpus and pflog gets to running
concurrently.
this changes pflog to use an mbuf on the stack to copy the headers
into and patch. the mbuf used to point to the trailing data has
been replaced with an m_hdr, also on the stack, like what bpf_mtap_ether
does to skip past where a vlan shim should be.
ok sashan@ jmatthew@
Diffstat (limited to 'share/mk')
0 files changed, 0 insertions, 0 deletions