Skip to content

feat: add support for original_dst for windows#529

Merged
Thomasdezeeuw merged 8 commits into
rust-lang:masterfrom
keithmattix:windows-original-dst
Nov 27, 2024
Merged

feat: add support for original_dst for windows#529
Thomasdezeeuw merged 8 commits into
rust-lang:masterfrom
keithmattix:windows-original-dst

Conversation

@keithmattix

@keithmattix keithmattix commented Sep 12, 2024

Copy link
Copy Markdown
Contributor

I noticed there wasn't support for original dst in Windows, so I added it. Also add windows gnu target to allow cross compiling

@Thomasdezeeuw Thomasdezeeuw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that at least Linux has SO_ORIGINAL_DST and IP6T_SO_ORIGINAL_DST as well, can we add it for it as well?

@keithmattix

Copy link
Copy Markdown
Contributor Author

@Thomasdezeeuw it's already added in the sys/unix.rs file:

pub fn original_dst(&self) -> io::Result<SockAddr> {

@Thomasdezeeuw

Copy link
Copy Markdown
Collaborator

@Thomasdezeeuw it's already added in the sys/unix.rs file:

pub fn original_dst(&self) -> io::Result<SockAddr> {

Ah, in that case it should be moved to the src/socket.rs file to ensure the API is the same across OS.

@keithmattix

Copy link
Copy Markdown
Contributor Author

Ok yeah I had that thought but wanted to confirm. Will make the change!

@keithmattix

Copy link
Copy Markdown
Contributor Author

@Thomasdezeeuw any clue what's going on with the FreeBSD CI? From what I can tell, it looks like it's failing due to the test runners not support ipv6

Comment thread src/socket.rs Outdated
Comment thread src/socket.rs
@keithmattix

Copy link
Copy Markdown
Contributor Author

I opened #534 to address the FreeBSD failures

@keithmattix

Copy link
Copy Markdown
Contributor Author

@Thomasdezeeuw gentle ping for review

Comment thread src/sys/unix.rs Outdated
Comment thread src/socket.rs Outdated
Comment thread src/socket.rs Outdated
Comment thread tests/socket.rs Outdated
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Comment thread src/sys/unix.rs Outdated
Comment thread src/sys/unix.rs Outdated
Comment thread src/sys/windows.rs Outdated
Comment thread src/sys/windows.rs Outdated
Comment thread tests/socket.rs Outdated
@Thomasdezeeuw Thomasdezeeuw mentioned this pull request Nov 27, 2024
@Thomasdezeeuw Thomasdezeeuw enabled auto-merge (squash) November 27, 2024 16:11
@Thomasdezeeuw Thomasdezeeuw merged commit 33a98be into rust-lang:master Nov 27, 2024
@Thomasdezeeuw

Copy link
Copy Markdown
Collaborator

Thanks @keithmattix

Hasan6979 pushed a commit to NordSecurity/socket2 that referenced this pull request May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants