Write the saved capture from the handle it was captured on - #37
Merged
Conversation
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 11:45
060ee91 to
4395653
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 11:46
4395653 to
6682099
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 11:47
6682099 to
0f230db
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 11:58
0f230db to
3f08850
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:15
3f08850 to
32e3312
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:24
32e3312 to
6aa59a2
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:26
6aa59a2 to
46b92a5
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:27
46b92a5 to
71b9cef
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:28
71b9cef to
e97f1ea
Compare
dumper_create opened a *second* live capture on the same interface, compiled the filter onto it again and ran its own pcap_loop in its own thread. So `-w` doubled the kernel capture cost and, because the two handles are independent, saved a different set of packets from the ones being analysed. It was also skipped entirely when reading a file, so `-r in.pcap -w out.pcap` silently wrote nothing. The sniffer now owns the dump file and writes each frame from its own handler, before anything is parsed, so the saved capture is exactly what libpcap delivered. That drops the second handle, the dumper thread and its loop, and makes -w work with -r. Assistant By Opus 5 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:31
e97f1ea to
d2a9484
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dumper_create opened a second live capture on the same interface,
compiled the filter onto it again and ran its own pcap_loop in its own
thread. So
-wdoubled the kernel capture cost and, because the twohandles are independent, saved a different set of packets from the ones
being analysed. It was also skipped entirely when reading a file, so
-r in.pcap -w out.pcapsilently wrote nothing.The sniffer now owns the dump file and writes each frame from its own
handler, before anything is parsed, so the saved capture is exactly what
libpcap delivered. That drops the second handle, the dumper thread and
its loop, and makes -w work with -r.
🤖 Generated with Claude Code