Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Derrick Pallas <derrick@pallas.us>
To: wireguard@lists.zx2c4.com
Subject: [PATCH 2/2] netdev: reset peer keys when changing private key
Date: Thu, 24 Jan 2019 17:53:39 -0800	[thread overview]
Message-ID: <20190125015339.27684-2-derrick@pallas.us> (raw)
In-Reply-To: <20190125015339.27684-1-derrick@pallas.us>

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@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

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

  reply	other threads:[~2019-01-25  1:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25  1:53 [PATCH 1/2] peer: add wg_peer_reset_keys Derrick Pallas
2019-01-25  1:53 ` Derrick Pallas [this message]
2019-07-11 15:37   ` [PATCH 2/2] netdev: reset peer keys when changing private key Jason A. Donenfeld
2019-07-15 17:17     ` Derrick Lyndon Pallas
2019-07-15 20:00       ` Jason A. Donenfeld
2019-03-13 22:46 [PATCH 1/2] peer: add wg_peer_reset_keys derrick
2019-03-13 22:46 ` [PATCH 2/2] netdev: reset peer keys when changing private key derrick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190125015339.27684-2-derrick@pallas.us \
    --to=derrick@pallas.us \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).