-
Notifications
You must be signed in to change notification settings - Fork 1k
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
adding tcp_info struct to linux musl/glibc. #3480
Conversation
r? @JohnTitor (rustbot has picked a reviewer for you, use r? to override) |
@bors r+ |
adding tcp_info struct to linux musl/glibc.
💔 Test failed - checks-actions |
89df119
to
719d94b
Compare
☔ The latest upstream changes (presumably #3486) made this pull request unmergeable. Please resolve the merge conflicts. |
719d94b
to
97a839d
Compare
@bors r+ |
adding tcp_info struct to linux musl/glibc.
💔 Test failed - checks-actions |
Could you check the CI failure? Seems musl gets confused 🤔 |
97a839d
to
4234bd2
Compare
@bors r+ |
5986fc0
to
b20092b
Compare
@rustbot review |
pub tcpi_backoff: u8, | ||
pub tcpi_options: u8, | ||
/* | ||
* FIXME: when musl headers are more up to date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* FIXME: when musl headers are more up to date | |
* FIXME(musl): when musl headers are more up to date |
Just so we can grep these things easy at the musl update
pub tcpi_bytes_retrans: u64, | ||
pub tcpi_dsack_dups: u32, | ||
pub tcpi_reord_seen: u32, | ||
// FIXME: to uncomment once CI musl is updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// FIXME: to uncomment once CI musl is updated | |
// FIXME(musl): to uncomment once CI musl is updated |
Same as above
src/unix/linux_like/linux/gnu/mod.rs
Outdated
// bitfields 4 | ||
pub tcpi_snd_wscale: u8, | ||
// bitfields 4 | ||
pub tcpi_rcv_wscale: u8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C header has these as
uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
doesn't that mean tcpi_snd_wscale
and tcpi_rcv_wscale
are located within the same u8
, and should be a single field in the Rust struct? Feel free to correct me if this is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to find what we do here in other cases, but it looks like this doesn't come up very often. Probably just make it one field and add a comment so users know:
/// The bitfield containing `tcpi_snd_wscale` and `tcpi_rcv_wscale`, four bits each.
pub tcpi_snd_rcv_wscale: u8
The musl section that is commented out should probably say something similar.
Checking headers https://github.com/kraj/glibc/blob/1927f718fcc48bdaea03086bdc2adf11279d655b/sysdeps/gnu/netinet/tcp.h#L226-L267 and https://github.com/kraj/musl/blob/2c41ee96f60074fa8ac387e1fcdedba0654fb173/include/netinet/tcp.h#L195-L250 this looks good, with some notes above. @rustbot author since I think this might need a change for the bitfield |
b20092b
to
8e362bd
Compare
8e362bd
to
ee0bf57
Compare
Thanks! @rustbot label +stable-nominated |
(backport <rust-lang#3480>) (cherry picked from commit ee0bf57)
(backport <rust-lang#3480>) (cherry picked from commit ee0bf57)
No description provided.