Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Get tcp_info structure #2615

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

Conversation

b-parikh
Copy link

@b-parikh b-parikh commented Mar 19, 2025

Implement TCP_INFO option for getsockopt.

What does this PR do

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

@b-parikh
Copy link
Author

Hello, it looks like the CI is failing for two reasons:

  1. A unit test is using the deprecated libc::SOCK_PACKET type.
  2. The tcp_info struct doesn't exist in the libc implementation of uClibc-ng.

The former is out of this PR's scope, so I won't address that here. However, I'd like advice on how to resolve the latter. Thank you!

@b-parikh b-parikh marked this pull request as ready for review March 19, 2025 05:40
@@ -1268,6 +1268,17 @@ sockopt_impl!(
libc::SO_EXCLBIND,
bool
);
#[cfg(target_os = "linux")]
Copy link
Member

Choose a reason for hiding this comment

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

Hi there

However, I'd like advice on how to resolve the latter.

If uClibc has that symbol, you can add it to the libc crate. Otherwise, we need to filter it out:

Suggested change
#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", not(target_env = "uclibc")))]

Comment on lines +1963 to +1964
- Added `TCP_INFO` sockopt to read TCP socket information on _linux_.
([#2615](https://github.com/nix-rust/nix/pull/2615))
Copy link
Member

Choose a reason for hiding this comment

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

@SteveLauC
Copy link
Member

A unit test is using the deprecated libc::SOCK_PACKET type.

Will be addressed in #2610

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants