-
Notifications
You must be signed in to change notification settings - Fork 207
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
fix(iroh-net): prevent adding addressing info that points back to us #2333
fix(iroh-net): prevent adding addressing info that points back to us #2333
Conversation
@divagant-martian what's missing from this to be ready? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I have mostly minor nits, now that I care more about public api docs :)
pub fn add_node_addr(&self, addr: NodeAddr) { | ||
self.node_map.add_node_addr(addr); | ||
pub fn add_node_addr(&self, mut addr: NodeAddr, source: node_map::Source) -> Result<()> { | ||
let my_addresses = self.endpoints.get().last_endpoints; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you felt like renaming self.endpoints
here to self.direct_addresses
or something i would not object... :) But I can also do this separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left it out. It feels out of scope since I'm not changing the field, simply using it here
…0-computer#2333) ## Description Failed disco boxes for which the sender is our own node is are because we tried to contact another node for which the addressing information we have points back to us. We are the sender (this explains the source of the disco box being ourselves) but we are not the meant recipient (thus the failed decryption - we should always be able to decrypt a message meant to ourselves - ). This is of course undesirable. This Pr should mostly mitigate this issue, but a failed disco box to ourselves can happen in other less likely ways. ## Breaking Changes n/a ## Notes & open questions n/a ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [ ] ~Tests if relevant.~ - [ ] ~All breaking changes documented.~
Description
Failed disco boxes for which the sender is our own node is are because we tried to contact another node for which the addressing information we have points back to us. We are the sender (this explains the source of the disco box being ourselves) but we are not the meant recipient (thus the failed decryption - we should always be able to decrypt a message meant to ourselves - ).
This is of course undesirable. This Pr should mostly mitigate this issue, but a failed disco box to ourselves can happen in other less likely ways.
Breaking Changes
n/a
Notes & open questions
n/a
Change checklist
Tests if relevant.All breaking changes documented.