Skip to content

Commit

Permalink
Merge pull request #466 from libpnet/bpf_hdr_repr
Browse files Browse the repository at this point in the history
Add #[repr(C)] for struct bpf_hdr.
  • Loading branch information
kishiguro committed Oct 9, 2020
2 parents 9e5a71f + c4c75ca commit 3e72775
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pnet_datalink/src/bindings/bpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pub struct sockaddr_dl {
all(any(target_os = "macos", target_os = "ios"), target_pointer_width = "32"),
windows
))]
#[repr(C)]
pub struct bpf_hdr {
pub bh_tstamp: libc::timeval,
pub bh_caplen: u32,
Expand All @@ -107,6 +108,7 @@ pub struct timeval32 {
target_os = "openbsd",
all(any(target_os = "macos", target_os = "ios"), target_pointer_width = "64")
))]
#[repr(C)]
pub struct bpf_hdr {
pub bh_tstamp: timeval32,
pub bh_caplen: u32,
Expand Down

0 comments on commit 3e72775

Please sign in to comment.