Skip to content
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

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

devnexen
Copy link
Contributor

@devnexen devnexen commented Mar 2, 2024

similar to linux's ext deferaccept, to filter incoming connections before accept.

@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2024

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot 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 Mar 2, 2024
@rust-log-analyzer

This comment has been minimized.

@devnexen devnexen marked this pull request as ready for review March 2, 2024 09:43
@bors
Copy link
Contributor

bors commented Mar 11, 2024

☔ The latest upstream changes (presumably #117156) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@Amanieu
Copy link
Member

Amanieu commented Mar 20, 2024

@devnexen Can you fix the CI failure?

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the O-netbsd Operating system: NetBSD label Mar 20, 2024
similar to linux's ext deferaccept, to filter incoming connections
before accept.
@Amanieu
Copy link
Member

Amanieu commented Mar 21, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 21, 2024

📌 Commit 19cb05f has been approved by Amanieu

It is now in the queue for this repository.

@bors bors 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 Mar 21, 2024
jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 21, 2024
std::net: adding acceptfilter feature for netbsd/freebsd.

similar to linux's ext deferaccept, to filter incoming connections before accept.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
std::net: adding acceptfilter feature for netbsd/freebsd.

similar to linux's ext deferaccept, to filter incoming connections before accept.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2024
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
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2024
…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
@bors bors merged commit f0feebb into rust-lang:master Mar 22, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2024
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;
Copy link
Member

@taiki-e taiki-e Mar 24, 2024

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]`

Copy link
Member

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.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 24, 2024
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`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 24, 2024
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``
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 24, 2024
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``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-netbsd Operating system: NetBSD O-unix Operating system: Unix-like S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants