boringtun
boringtun copied to clipboard
device: Allow modifying peers
Currently, updating peers without replacing them is not implemented, which can mess up state tracking, especially when the last handshake time stops being a thing all of a sudden. This commit introduces API changes to Peer to allow modifying specific fields and replaces the panic macro with actual setting of said fields.
Fixes https://github.com/cloudflare/boringtun/issues/40
@Noah-Kennedy
@ernestask I am rewriting device. It should be done shortly. Once this is in, I'd suggest redoing this.
All right, thanks for the heads-up!
Does 0.5.0 mark the device rewrite?
Not yet, that work got split out sadly.
Thanks for this work @ernestask to give us something to work with until Noah's rewrite is done!
Hey @Noah-Kennedy ,
Are you still working on the rewrite?
There is the noah/tokio
branch, but I’m not sure if that’s it.
In any case, we’ve been running this code in production (https://github.com/NordSecurity/boringtun/tree/libtelio-master, fairly old base, but we’re already rebasing atop 0.5.2) with only a single issue propping up, which I’ve fixed here recently. Hard to say what would happen post-rewrite, but it might be someone else proposing a different solution.