[PATCH 2/2] netdev: reset peer keys when changing private key

Derrick Pallas derrick at pallas.us
Fri Jan 25 02:53:39 CET 2019


Without this change, it can take until the handshake timeout period to
reestablish with the peer.  After this change, the handshake occurs as soon
as possible and the link is reestablished much more quickly.

Signed-off-by: Derrick Pallas <derrick at pallas.us>
---
 src/netlink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/netlink.c b/src/netlink.c
index 3458c81..f6b10ad 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -539,6 +539,8 @@ static int wg_set_device(struct sk_buff *skb, struct genl_info *info)
 					 peer_list) {
 			if (!wg_noise_precompute_static_static(peer))
 				wg_peer_remove(peer);
+			else
+				wg_peer_reset_keys(peer);
 		}
 		wg_cookie_checker_precompute_device_keys(&wg->cookie_checker);
 		up_write(&wg->static_identity.lock);
-- 
2.19.2



More information about the WireGuard mailing list