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

remove InetAddr from streamer/src/recvmmsg.rs #558

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

yihau
Copy link
Member

@yihau yihau commented Apr 3, 2024

Problem

#556

Summary of Changes

remove InetAddr from streamer/src/recvmmsg.rs

@yihau yihau mentioned this pull request Apr 3, 2024
3 tasks
@yihau yihau marked this pull request as ready for review April 3, 2024 17:54
@yihau yihau requested a review from behzadnouri April 3, 2024 17:54
@@ -44,21 +45,29 @@ pub fn recv_mmsg(socket: &UdpSocket, packets: &mut [Packet]) -> io::Result</*num

#[cfg(target_os = "linux")]
#[allow(deprecated)]

Choose a reason for hiding this comment

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

remove this line?

Copy link
Member Author

Choose a reason for hiding this comment

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

ah yeah. let me push a new commit to fix this one

Copy link
Member Author

@yihau yihau Apr 4, 2024

Choose a reason for hiding this comment

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

fixed: 352b9e4

had a rebase. the fix becomes 6f7c506

Comment on lines +56 to +58
return Some(SocketAddr::V4(SocketAddrV4::new(
Ipv4Addr::from(addr.sin_addr.s_addr.to_ne_bytes()),
u16::from_be(addr.sin_port),
)));

Choose a reason for hiding this comment

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

I don't know if these conversions are correct, and it is odd that one uses to_ne_bytes and the other from_be.
Is there any reference for where these come from?
Or can we add some test coverage here?

Similarly for Ipv6Addr below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Can you please put that link as a comment in the code?

I also see they have a different code for #[cfg(windows)]. any reason to not include that here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you please put that link as a comment in the code?

sure! fixed: 0d04bf1

I also see they have a different code for #[cfg(windows)]. any reason to not include that here?

afaik cast_socket_addr has #[cfg(target_os = "linux")] so it will never touch the windows condition
https://github.com/anza-xyz/agave/pull/558/files#diff-2d88fdbf6278e2d0250658ffc2903c9a6701e9b68e3e2303a23691b50bc298e2R46-R47

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 50.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 81.8%. Comparing base (2c11b7a) to head (0d04bf1).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #558     +/-   ##
=========================================
- Coverage    81.8%    81.8%   -0.1%     
=========================================
  Files         849      849             
  Lines      229183   229189      +6     
=========================================
- Hits       187585   187564     -21     
- Misses      41598    41625     +27     

Copy link

@behzadnouri behzadnouri left a comment

Choose a reason for hiding this comment

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

lgtm, though we better add some unit tests for these conversions.

@yihau yihau merged commit 562254e into anza-xyz:master Apr 5, 2024
38 checks passed
@yihau yihau deleted the bump-nix-part2 branch April 5, 2024 08:51
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