Module Name: src
Committed By: riastradh
Date: Sun Jul 28 14:50:05 UTC 2024
Modified Files:
src/sys/net: if_wg.c
Log Message:
wg(4): Parenthesize macro expansions properly.
PR kern/58480: experimental wg(4) sliding window logic has oopsie
To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/net/if_wg.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_wg.c
diff -u src/sys/net/if_wg.c:1.109 src/sys/net/if_wg.c:1.110
--- src/sys/net/if_wg.c:1.109 Sun Jul 28 14:49:49 2024
+++ src/sys/net/if_wg.c Sun Jul 28 14:50:05 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wg.c,v 1.109 2024/07/28 14:49:49 riastradh Exp $ */
+/* $NetBSD: if_wg.c,v 1.110 2024/07/28 14:50:05 riastradh Exp $ */
/*
* Copyright (C) Ryota Ozaki <[email protected]>
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.109 2024/07/28 14:49:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.110 2024/07/28 14:50:05 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq_enabled.h"
@@ -331,7 +331,7 @@ wg_dump_hash(const uint8_t *func, const
#define WG_ALLOWEDIPS 16
#define CURVE25519_KEY_LEN 32
-#define TAI64N_LEN sizeof(uint32_t) * 3
+#define TAI64N_LEN (sizeof(uint32_t) * 3)
#define POLY1305_AUTHTAG_LEN 16
#define HMAC_BLOCK_LEN 64
@@ -426,7 +426,7 @@ struct wg_msg_cookie {
#define SLIWIN_BITS 2048u
#define SLIWIN_TYPE uint32_t
-#define SLIWIN_BPW NBBY*sizeof(SLIWIN_TYPE)
+#define SLIWIN_BPW (NBBY*sizeof(SLIWIN_TYPE))
#define SLIWIN_WORDS howmany(SLIWIN_BITS, SLIWIN_BPW)
#define SLIWIN_NPKT (SLIWIN_BITS - NBBY*sizeof(SLIWIN_TYPE))