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

Make MetaAddr.addr a private field #2357

Closed
2 tasks
teor2345 opened this issue Jun 21, 2021 · 1 comment
Closed
2 tasks

Make MetaAddr.addr a private field #2357

teor2345 opened this issue Jun 21, 2021 · 1 comment
Labels
A-network Area: Network protocol updates or fixes A-rust Area: Updates to Rust code C-security Category: Security issues I-remote-node-overload Zebra can overload other nodes on the network

Comments

@teor2345
Copy link
Contributor

Motivation

In PR #2276, we make sure that all SocketAddrs are canonical in the MetaAddr and MetaAddrChange constructors.

But other code can still make the addr field non-canonical, because it's pub(crate).

Solution

  • Add a MetaAddr::addr() method
  • Make the MetaAddr.addr field private, replacing accesses with the method

Alternatives

If we don't make this change, we risk future bugs where Zebra connects multiple times to the same canonical peer address, because it is storing different variants of that address in the address book.

@teor2345 teor2345 added A-rust Area: Updates to Rust code S-needs-triage Status: A bug report needs triage P-Medium C-security Category: Security issues I-remote-node-overload Zebra can overload other nodes on the network A-network Area: Network protocol updates or fixes labels Jun 21, 2021
@teor2345
Copy link
Contributor Author

Obsoleted by #2364.

@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Jun 22, 2021
@mpguerra mpguerra closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-network Area: Network protocol updates or fixes A-rust Area: Updates to Rust code C-security Category: Security issues I-remote-node-overload Zebra can overload other nodes on the network
Projects
None yet
Development

No branches or pull requests

2 participants