wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: derrick@pallas.us
To: wireguard@lists.zx2c4.com
Subject: [PATCH 2/2] netdev: reset peer keys when changing private key
Date: Wed, 13 Mar 2019 15:46:43 -0700	[thread overview]
Message-ID: <20190313224643.17904-2-derrick@pallas.us> (raw)
In-Reply-To: <20190313224643.17904-1-derrick@pallas.us>

From: Derrick Pallas <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 b179b31..43e1e05 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -551,6 +551,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-03-13 22:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 22:46 [PATCH 1/2] peer: add wg_peer_reset_keys derrick
2019-03-13 22:46 ` derrick [this message]
2019-03-14  6:47 ` Triffid Hunter
2019-04-04 19:20   ` Derrick Lyndon Pallas
  -- strict thread matches above, loose matches on Subject: below --
2019-01-25  1:53 Derrick Pallas
2019-01-25  1:53 ` [PATCH 2/2] netdev: reset peer keys when changing private key Derrick Pallas
2019-07-11 15:37   ` Jason A. Donenfeld
2019-07-15 17:17     ` Derrick Lyndon Pallas
2019-07-15 20:00       ` Jason A. Donenfeld

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=20190313224643.17904-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).