3

std::net: adding acceptfilter feature for netbsd/freebsd. by devnexen · Pull Req...

 1 month ago
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.

Collaborator

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

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

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.

rustbot

added the O-netbsd Operating system: NetBSD label

Mar 20, 2024

Member

@bors r+

Contributor

📌 Commit 19cb05f has been approved by Amanieu

It is now in the queue for this repository.

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

bors

merged commit f0feebb into

rust-lang:master

Mar 22, 2024

11 checks passed

rust-timer

added a commit to rust-lang-ci/rust that referenced this pull request

Mar 22, 2024

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

Reviewers

taiki-e

taiki-e left review comments
Assignees

Amanieu

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

Milestone

1.79.0

Development

Successfully merging this pull request may close these issues.

None yet

6 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK