-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
std::net: adding acceptfilter feature for netbsd/freebsd. #121881
Conversation
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #117156) made this pull request unmergeable. Please resolve the merge conflicts. |
05aaa08
to
5a503e7
Compare
This comment has been minimized.
This comment has been minimized.
@devnexen Can you fix the CI failure? |
5a503e7
to
ef261a8
Compare
This comment has been minimized.
This comment has been minimized.
similar to linux's ext deferaccept, to filter incoming connections before accept.
226ed00
to
19cb05f
Compare
@bors r+ |
std::net: adding acceptfilter feature for netbsd/freebsd. similar to linux's ext deferaccept, to filter incoming connections before accept.
std::net: adding acceptfilter feature for netbsd/freebsd. similar to linux's ext deferaccept, to filter incoming connections before accept.
Rollup of 6 pull requests Successful merges: - rust-lang#121881 (std::net: adding acceptfilter feature for netbsd/freebsd.) - rust-lang#122817 (Doc Guarantee: BTree(Set|Map): `IntoIter` Iterate in Sorted by key Order) - rust-lang#122829 (Implement `FusedIterator` for `gen` block) - rust-lang#122831 (make failure logs less verbose) - rust-lang#122837 (add test for rust-lang#122549) - rust-lang#122838 (Avoid noop rewrite of issues.txt) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#121881 (std::net: adding acceptfilter feature for netbsd/freebsd.) - rust-lang#122817 (Doc Guarantee: BTree(Set|Map): `IntoIter` Iterate in Sorted by key Order) - rust-lang#122826 (Add tests for shortcomings of associated type bounds) - rust-lang#122829 (Implement `FusedIterator` for `gen` block) - rust-lang#122831 (make failure logs less verbose) - rust-lang#122837 (add test for rust-lang#122549) - rust-lang#122838 (Avoid noop rewrite of issues.txt) - rust-lang#122841 (add 2 more tests for issues fixed by rust-lang#122749) - rust-lang#122843 (Add a never type option to make diverging blocks `()`) - rust-lang#122844 (add test for ice "cannot relate region: LUB(ReErased, ReError)") - rust-lang#122845 (Clippy subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121881 - devnexen:bsd_acceptfilter, r=Amanieu std::net: adding acceptfilter feature for netbsd/freebsd. similar to linux's ext deferaccept, to filter incoming connections before accept.
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; |
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.
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]`
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 opened #122983 to fix this.
Fix build failure on ARM/AArch64/PowerPC/RISC-V FreeBSD/NetBSD Fixes rust-lang#121881 (comment) Checked targets: aarch64-unknown-freebsd, powerpc64-unknown-freebsd, armv7-unknown-freebsd, riscv64gc-unknown-freebsd, aarch64-unknown-netbsd. r? `@Amanieu` cc `@devnexen`
Fix build failure on ARM/AArch64/PowerPC/RISC-V FreeBSD/NetBSD Fixes rust-lang#121881 (comment) Checked targets: aarch64-unknown-freebsd, powerpc64-unknown-freebsd, armv7-unknown-freebsd, riscv64gc-unknown-freebsd, aarch64-unknown-netbsd. r? ``@Amanieu`` cc ``@devnexen``
Rollup merge of rust-lang#122983 - taiki-e:bsd, r=workingjubilee Fix build failure on ARM/AArch64/PowerPC/RISC-V FreeBSD/NetBSD Fixes rust-lang#121881 (comment) Checked targets: aarch64-unknown-freebsd, powerpc64-unknown-freebsd, armv7-unknown-freebsd, riscv64gc-unknown-freebsd, aarch64-unknown-netbsd. r? ``@Amanieu`` cc ``@devnexen``
similar to linux's ext deferaccept, to filter incoming connections before accept.