FreeBSD: Support kernel-offloaded TLS TCP#4482
Conversation
b60cffa to
7e42c78
Compare
|
For nightly freebsd-15 ci task to success, you would need to update the ci freebsd env with the new headers. I have no idea why freebsd-13 is failing. |
|
@asomers would you mind reviewing this since it's FreeBSD?
If there is a version bump available, feel freeto submit a PR updating it. I'm not sure about freebsd-13 either, ctest seems extremely flaky on that target. |
Is there an existing example of the PR with such update? |
|
You just want to update a minor freebsd version? I don't know one off the top of my head but it shouldn't be too hard, the FreeBSD CI config is in https://github.com/rust-lang/libc/blob/9c8cd59b2367ce9cd5acd6247c3764cdf670a9f8/.cirrus.yml |
Our CI config uses the latest FreeBSD 15 snapshot on GCE. So we don't need to do anything. If we just wait, GCE will have the latest release soon enough. |
asomers
left a comment
There was a problem hiding this comment.
Cool project, kib! I look forward to trying it.
| pub _xig_spare32: u32, | ||
| pub xig_gen: inp_gen_t, | ||
| pub xig_sogen: so_gen_t, | ||
| pub _xig_spare64: [u64; 4], |
There was a problem hiding this comment.
The convention used elsewhere in libc is to make spare and padding fields private. The forces consumers to initialize with mem::zeroed, but it also makes it easier for future versions of libc to replace those spare fields with no backwards-compatibility problems.
| pub _xig_spare32: u32, | |
| pub xig_gen: inp_gen_t, | |
| pub xig_sogen: so_gen_t, | |
| pub _xig_spare64: [u64; 4], | |
| _xig_spare32: u32, | |
| pub xig_gen: inp_gen_t, | |
| pub xig_sogen: so_gen_t, | |
| _xig_spare64: [u64; 4], |
| } | ||
|
|
||
| pub struct in_addr_4in6 { | ||
| pub ia46_pad32: [u32; 3], |
There was a problem hiding this comment.
| pub ia46_pad32: [u32; 3], | |
| ia46_pad32: [u32; 3], |
| pub inp_gencnt: u64, | ||
| pub so_pcb: kvaddr_t, | ||
| pub coninf: crate::in_conninfo, | ||
| pub rx_vlan_id: c_short, |
There was a problem hiding this comment.
| pub rx_vlan_id: c_short, | |
| pub rx_vlan_id: c_ushort, |
|
Could you please push this? |
|
I rebased this to pick up a new set of CI runs since one thing was fixed. The FreeBSD-15 and FreeBSD-13 x86-64 jobs are spurious, but the FreeBSD-13 i686 "bad xinpgen align: rust: 4 (0x4) != c 8 (0x8)" message looks legit. Is one of these fields actually a different size on 32-bit? |
| __spare__: [c_int; 4], | ||
| } | ||
|
|
||
| pub struct xinpgen { |
There was a problem hiding this comment.
I think this will fix the latest test failure on i386.
| pub struct xinpgen { | |
| #[repr(align(8)] | |
| pub struct xinpgen { |
There was a problem hiding this comment.
Right, can I still update the branch, or should the change be a fixup?
Hm, no. The reason for the message is the attribute of the C structure, declaring 8-bytes alignment. Would it be enough to add |
|
You don't need to include |
So I added a commit with the align. If you want me to squash, please say so. |
tgross35
left a comment
There was a problem hiding this comment.
Thanks! No need to squash everything to one but if you combine the align fix with whatever added the struct, that would make a bit more clean cherry pick.
Squashed just the fix. |
|
Thanks! |
(backport <rust-lang#4482>) (cherry picked from commit 8443057)
(backport <rust-lang#4482>) (cherry picked from commit 7d2a695)
(backport <rust-lang#4482>) (cherry picked from commit 34e3b14)
(backport <rust-lang#4482>) (cherry picked from commit 9220aac)
…older (backport <rust-lang#4482>) (cherry picked from commit db4dba7)
Description
The PR adds definitions for kernel-offloaded TLS TCP session information sysctls. It is used by the utility to list kTLS connections https://github.com/kostikbel/ktcplist
Sources
https://github.com/freebsd/freebsd-src/blob/4078e0d1d6f8189bff44fcad04df256220035f76/sys/sys/ktls.h
freebsd/freebsd-src@c9e9a0f
@rustbot label +stable-nominated