bpf: adjust bpf_ts on FreeBSD - #5077
Open
evverx wants to merge 1 commit into
Open
Conversation
to get scapy to capture packets on both 32-bit and 64-bit machines. The bpf_ts structure contains two 64-bit fields: https://github.com/freebsd/freebsd-src/blob/aea4240ef5834fb4a47f80c659c80f902cb4bb06/sys/net/bpf.h#L206-L209 ``` struct bpf_ts { bpf_int64 bt_sec; /* seconds */ bpf_u_int64 bt_frac; /* fraction */ }; ``` and it has been this way since it was introduced in freebsd/freebsd-src@547d94b back in 2010. ``` Introduce new time stamp 'struct bpf_ts' and header 'struct bpf_xhdr'. The new time stamp has both 64-bit second and fractional parts. bpf_xhdr has this time stamp instead of 'struct timeval' for bh_tstamp. The new structures let us use bh_tstamp of same size on both 32-bit and 64-bit platforms without adding additional shims for 32-bit binaries. ``` It was tested on FreeBSD 14.4-RELEASE/i386 and 15.1-RELEASE-p2/amd64. AI-Assisted: no
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5077 +/- ##
==========================================
- Coverage 80.48% 80.31% -0.18%
==========================================
Files 390 390
Lines 96810 96810
==========================================
- Hits 77917 77750 -167
- Misses 18893 19060 +167
🚀 New features to boost your workflow:
|
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.
to get scapy to capture packets on both 32-bit and 64-bit machines.
The bpf_ts structure contains two 64-bit fields:
https://github.com/freebsd/freebsd-src/blob/aea4240ef5834fb4a47f80c659c80f902cb4bb06/sys/net/bpf.h#L206-L209
and it has been this way since it was introduced in freebsd/freebsd-src@547d94b back in 2010.
It was tested on FreeBSD 14.4-RELEASE/i386 and 15.1-RELEASE-p2/amd64.