Build with -Wextra and modernise the capture device setup - #39
Merged
Conversation
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 11:45
6112af8 to
2f40818
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 11:45
95f3105 to
858298e
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 11:46
2f40818 to
b2ab59e
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 11:46
858298e to
6890e0f
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 11:47
b2ab59e to
86e90ef
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
2 times, most recently
from
September 2, 2026 11:58
f60b078 to
74b1b83
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:15
429a565 to
72fa0d8
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 12:15
74b1b83 to
aaaff4c
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:24
72fa0d8 to
21a0828
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 12:24
aaaff4c to
b11586e
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:26
21a0828 to
da92808
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 12:26
b11586e to
b45045a
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:27
da92808 to
1c27aee
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 12:27
b45045a to
ae8a007
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:28
1c27aee to
b3b0c72
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 12:28
ae8a007 to
43c709f
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:31
b3b0c72 to
8584a14
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 12:31
43c709f to
2adb55c
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:34
8584a14 to
9406c9a
Compare
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 12:34
2adb55c to
b8d5274
Compare
- hashtable compared strlen's size_t against an int in three places,
which is what -Wextra was reporting, and read a uint32_t straight
out of the key with a cast. That load is undefined for an unaligned
key and faults outright on a strict-alignment target; memcpy says
the same thing and compiles to the same instruction.
- sniffer_online called pcap_lookupnet purely to bail out when it
failed: neither the network nor the mask it returns is ever used.
That made a capture on an interface with no IPv4 address fail for no
reason. Dropped.
- Replace pcap_lookupdev, which is deprecated and hands back a shared
buffer, with pcap_findalldevs. The fallback now also skips loopback
unless it is the only device there is. Reaching this path needs
root, since the uid check runs first, so it is covered by inspection
and by exercising pcap_findalldevs directly rather than by a test.
- Turn on -Wextra now that the tree is clean under it.
Assistant By Opus 5
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
git-hulk
force-pushed
the
fix-warnings-and-device-setup
branch
from
September 2, 2026 12:38
b8d5274 to
d21e0ab
Compare
git-hulk
changed the base branch from
design-established-connections
to
master
September 2, 2026 12:38
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.
hashtable compared strlen's size_t against an int in three places,
which is what -Wextra was reporting, and read a uint32_t straight
out of the key with a cast. That load is undefined for an unaligned
key and faults outright on a strict-alignment target; memcpy says
the same thing and compiles to the same instruction.
sniffer_online called pcap_lookupnet purely to bail out when it
failed: neither the network nor the mask it returns is ever used.
That made a capture on an interface with no IPv4 address fail for no
reason. Dropped.
Replace pcap_lookupdev, which is deprecated and hands back a shared
buffer, with pcap_findalldevs. The fallback now also skips loopback
unless it is the only device there is. Reaching this path needs
root, since the uid check runs first, so it is covered by inspection
and by exercising pcap_findalldevs directly rather than by a test.
Turn on -Wextra now that the tree is clean under it.
🤖 Generated with Claude Code