Development discussion of WireGuard
 help / color / Atom feed
* [PATCH] Do not assign in if condition wg_noise_handshake_consume_initiation()
@ 2020-06-09 15:21 Frank Werner-Krippendorf
  2020-06-10  3:42 ` Jason A. Donenfeld
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Werner-Krippendorf @ 2020-06-09 15:21 UTC (permalink / raw)
  To: Jason A. Donenfeld, David S. Miller, Jakub Kicinski, wireguard,
	netdev, linux-kernel
  Cc: Frank Werner-Krippendorf

Fixes an error condition reported by checkpatch.pl which caused by
assigning a variable in an if condition in
wg_noise_handshake_consume_initiation().

Signed-off-by: Frank Werner-Krippendorf <mail@hb9fxq.ch>
---
 drivers/net/wireguard/noise.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireguard/noise.c b/drivers/net/wireguard/noise.c
index 626433690abb..9524a15a62a6 100644
--- a/drivers/net/wireguard/noise.c
+++ b/drivers/net/wireguard/noise.c
@@ -617,8 +617,9 @@ wg_noise_handshake_consume_initiation(struct message_handshake_initiation *src,
 	memcpy(handshake->hash, hash, NOISE_HASH_LEN);
 	memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN);
 	handshake->remote_index = src->sender_index;
+	initiation_consumption = ktime_get_coarse_boottime_ns();
 	if ((s64)(handshake->last_initiation_consumption -
-	    (initiation_consumption = ktime_get_coarse_boottime_ns())) < 0)
+	    initiation_consumption) < 0)
 		handshake->last_initiation_consumption = initiation_consumption;
 	handshake->state = HANDSHAKE_CONSUMED_INITIATION;
 	up_write(&handshake->lock);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Do not assign in if condition wg_noise_handshake_consume_initiation()
  2020-06-09 15:21 [PATCH] Do not assign in if condition wg_noise_handshake_consume_initiation() Frank Werner-Krippendorf
@ 2020-06-10  3:42 ` Jason A. Donenfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Jason A. Donenfeld @ 2020-06-10  3:42 UTC (permalink / raw)
  To: Frank Werner-Krippendorf
  Cc: David S. Miller, Jakub Kicinski, WireGuard mailing list, Netdev, LKML

On Tue, Jun 9, 2020 at 9:21 AM Frank Werner-Krippendorf <mail@hb9fxq.ch> wrote:
>
> Fixes an error condition reported by checkpatch.pl which caused by
> assigning a variable in an if condition in
> wg_noise_handshake_consume_initiation().
>
> Signed-off-by: Frank Werner-Krippendorf <mail@hb9fxq.ch>

Thanks. Queued up in the wireguard-linux.git tree.

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09 15:21 [PATCH] Do not assign in if condition wg_noise_handshake_consume_initiation() Frank Werner-Krippendorf
2020-06-10  3:42 ` Jason A. Donenfeld

Development discussion of WireGuard

Archives are clonable: git clone --mirror http://inbox.vuxu.org/wireguard

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.wireguard


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git