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

Add Methods to SocketDigest for Retrieving SO_ORIGINAL_DST Information #387

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ermakov-oleg
Copy link

@ermakov-oleg ermakov-oleg force-pushed the original-dst branch 2 times, most recently from 9654ab2 to 3adf53c Compare September 17, 2024 18:16
@eaufavor eaufavor added the enhancement New feature or request label Sep 19, 2024
@andrewhavck andrewhavck self-assigned this Sep 20, 2024
@@ -335,6 +337,42 @@ pub fn get_socket_cookie(_fd: RawFd) -> io::Result<u64> {
Ok(0) // SO_COOKIE is a Linux concept
}

#[cfg(target_os = "linux")]
pub fn get_original_dest_v4(fd: RawFd) -> io::Result<Option<SocketAddr>> {
Copy link
Contributor

@andrewhavck andrewhavck Sep 20, 2024

Choose a reason for hiding this comment

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

Rather than have two functions for this based on the IP version I'd prefer we did something similar to set_dscp where we check it in the function itself, this is simpler for the caller.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, thank you, good point.

@ermakov-oleg ermakov-oleg force-pushed the original-dst branch 4 times, most recently from f65912c to a9829f5 Compare September 20, 2024 21:22
@ermakov-oleg
Copy link
Author

@andrewhavck Builds on Rust 1.72 are failing due to the latest boring-sys release (v4.10.*), where bindgen was updated (see: cloudflare/boring#273). Any suggestions on how to resolve this or work around the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants