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

Replace daddr checks with ip().is_unspecified() #656

Closed
aeyakovenko opened this issue Jul 17, 2018 · 5 comments
Closed

Replace daddr checks with ip().is_unspecified() #656

aeyakovenko opened this issue Jul 17, 2018 · 5 comments
Labels
good first issue Good for newcomers

Comments

@aeyakovenko
Copy link
Member

Rust added a function to IpAddr to check if its unspecified. The code should call that method instead of comparing against 0.0.0.0:0.

@aeyakovenko aeyakovenko added the good first issue Good for newcomers label Jul 17, 2018
@martiuslim
Copy link
Contributor

Would love to give this a shot! Would just like to clarify if the below snippets are heading in the right direction for this issue?

  • else if v.contact_info.tvu == daddr to else if v.contact_info.tvu.is_unspecified()
  • .filter(|r| r.id != self.me && r.contact_info.tvu_window != daddr) to .filter(|r| r.id != self.me && !(r.contact_info.tvu_window.is_unspecified()))

@aeyakovenko
Copy link
Member Author

Yes!

I would define a function ‘is_valid_address’ which checks that the port is nonzero, and address is not unspecified or multicast

@martiuslim
Copy link
Contributor

Ah I see. May I kindly check where would be the best place to define this function?

@aeyakovenko
Copy link
Member Author

Inside the Crdt class, so it can be called context free ‘Crdt::is_valid_address’

@martiuslim
Copy link
Contributor

looks like this can be closed, ref: #721

vkomenda pushed a commit to vkomenda/solana that referenced this issue Aug 29, 2021
jeffwashington added a commit to jeffwashington/solana that referenced this issue Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants