std::net: adding acceptfilter feature for netbsd/freebsd. by devnexen · Pull Req...
source link: https://github.com/rust-lang/rust/pull/121881
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
std::net: adding acceptfilter feature for netbsd/freebsd. #121881
Conversation
Contributor
similar to linux's ext deferaccept, to filter incoming connections before accept.
added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
labels
This comment has been minimized.
Contributor
☔ The latest upstream changes (presumably #117156) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
Member
@devnexen Can you fix the CI failure? |
This comment has been minimized.
Member
@bors r+ |
added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
const AF_NAME_MAX: usize = 16; |
||
let mut buf = [0; AF_NAME_MAX]; |
||
for (src, dst) in name.to_bytes().iter().zip(&mut buf[..AF_NAME_MAX - 1]) { |
||
*dst = *src as i8; |
Member
This should be as libc::c_char
. (c_char is u8 by default on most non-Apple/non-Windows ARM/AArch64/PowerPC/RISC-V/s390x/Hexagon targets)
# with empty crate
$ cargo check -Z build-std --target aarch64-unknown-freebsd
error[E0308]: mismatched types
--> /Users/taiki/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/pal/unix/net.rs:465:27
|
461 | for (src, dst) in name.to_bytes().iter().zip(&mut buf[..AF_NAME_MAX - 1]) {
| --- here the type of `buf` is inferred to be `[i8; 16]`
...
465 | arg.af_name = buf;
| ----------- ^^^ expected `[u8; 16]`, found `[i8; 16]`
| |
| expected due to the type of this binding
|
= note: expected array `[u8; 16]`
found array `[i8; 16]`
I opened #122983 to fix this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK