Skip to content

FreeBSD ktls fixes #4552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,8 @@ fn test_freebsd(target: &str) {
"sys/shm.h",
"sys/socket.h",
"sys/socketvar.h",
"netinet/in_pcb.h", // must be after sys/socketvar.h
[freebsd15]:"sys/ktls.h",
"netinet/in_pcb.h", // must be after sys/socketvar.h, sys/ktls.h
"sys/stat.h",
"sys/statvfs.h",
"sys/sysctl.h",
Expand Down Expand Up @@ -2527,6 +2528,8 @@ fn test_freebsd(target: &str) {
"type_" if struct_ == "sockstat" => "type".to_string(),
"type_" if struct_ == "devstat_match_table" => "type".to_string(),
"type_" if struct_ == "input_event" => "type".to_string(),
// Field is named `gennum` in Rust because `gen` is a keyword
"gennum" if struct_ == "xktls_session_onedir" => "gen".to_string(),
s => s.to_string(),
}
});
Expand Down
4 changes: 3 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ s! {
// This is normally "struct pwddesc".
/// Pointer to process paths info.
pub ki_pd: *mut c_void,
/// Address of the ext err msg place
pub ki_uerrmsg: *mut c_void,
pub ki_spareptrs: [*mut c_void; crate::KI_NSPARE_PTR],
pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG],
/// PS_* flags.
Expand Down Expand Up @@ -445,7 +447,7 @@ pub const KF_TYPE_EVENTFD: c_int = 13;

/// max length of devicename
pub const SPECNAMELEN: c_int = 255;
pub const KI_NSPARE_PTR: usize = 5;
pub const KI_NSPARE_PTR: usize = 4;

/// domainset policies
pub const DOMAINSET_POLICY_INVALID: c_int = 0;
Expand Down
4 changes: 3 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,8 @@ s_no_extra_traits! {
}

pub struct xktls_session_onedir {
// Note: this field is called `gen` in upstream FreeBSD, but `gen` is
// reserved keyword in Rust since the 2024 Edition, hence `gennum`.
pub gennum: u64,
_rsrv1: [u64; 8],
_rsrv2: [u32; 8],
Expand All @@ -1779,7 +1781,7 @@ s_no_extra_traits! {
pub tls_bs: u8,
pub flags: u8,
pub drv_st_len: u16,
pub ifnet: [u8; 16],
pub ifnet: [c_char; 16],
}

pub struct xktls_session {
Expand Down
Loading