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 v4 and v6 versions of bind_device_by_index. #432

Merged
merged 1 commit into from
May 29, 2023

Conversation

pinkisemils
Copy link
Contributor

I've added IPvX versioned functions for bind_device_by_index and deprecated the original, as discussed in #413.

I've added a change log entry (and thus tentatively declaring a new verison), but I'm unsure if that's the correct thing to do here.

src/sys/unix.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

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

One last thing I missed in the first review round.

src/sys/unix.rs Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
@Thomasdezeeuw
Copy link
Collaborator

@pinkisemils if you apply my suggested changes it should fix the CI.

@pinkisemils pinkisemils force-pushed the add-ipv6-bind-by-index branch 2 times, most recently from 4d1e699 to 5262f5f Compare May 23, 2023 15:16
Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

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

Sorry, I messed up the doc links the first time. I tried pushing to the branch, but GitHub wouldn't allow me.

src/sys/unix.rs Outdated
@@ -1833,6 +1833,33 @@ impl crate::Socket {
.map(|_| ())
}

/// This method is deprecated, use [`Socket2::bind_device_by_index_v4`].
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// This method is deprecated, use [`Socket2::bind_device_by_index_v4`].
/// This method is deprecated, use [`Socket::bind_device_by_index_v4`].
///
/// [`Socket::bind_device_by_index_v4`]: crate::Socket::bind_device_by_index_v4

src/sys/unix.rs Outdated
let index =
unsafe { getsockopt::<libc::c_uint>(self.as_raw(), IPPROTO_IP, libc::IP_BOUND_IF)? };
Ok(NonZeroU32::new(index))
}

/// This method is deprecated, use [`Socket::device_index_v4`].
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// This method is deprecated, use [`Socket::device_index_v4`].
/// This method is deprecated, use [`Socket::device_index_v4`].
///
/// [`Socket::device_index_v4`]: crate::Socket::device_index_v4

@Thomasdezeeuw Thomasdezeeuw merged commit 5ca3960 into rust-lang:master May 29, 2023
@Thomasdezeeuw
Copy link
Collaborator

Thanks for sticking with this @pinkisemils, sorry it took a little while.

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.

3 participants