iroh
iroh copied to clipboard
Do not ignore local addresses in MagicSock::add_node_addr
At some point we struggled with receiving packets we sent ourself. We solved this by adding a check to MagicSock::add_node_addr to avoid adding the addr to ourselves.
But this is the wrong point in time. Our own endpoint can move around on the network and the local address will change. What once was a conflict with out local address is no longer, and more importantly vice versa!
Instead we should handle this when selecting a path to be used in the (new) NodeStateActor. This needs to be made aware of the current local addresses, probably using a watcher. Then whenever it is selecting paths to reach a remote node it can filter out the current local addresses.