summaryrefslogtreecommitdiffhomepage
path: root/src/selftest/counter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/selftest/counter.c')
-rw-r--r--src/selftest/counter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/selftest/counter.c b/src/selftest/counter.c
index 7e14eeb..0d8b192 100644
--- a/src/selftest/counter.c
+++ b/src/selftest/counter.c
@@ -17,7 +17,7 @@ bool __init wg_packet_counter_selftest(void)
#define T_LIM (COUNTER_WINDOW_SIZE + 1)
#define T(n, v) do { \
++test_num; \
- if (counter_validate(&counter, n) != v) { \
+ if (counter_validate(&counter, n) != (v)) { \
pr_err("nonce counter self-test %u: FAIL\n", \
test_num); \
success = false; \
@@ -92,6 +92,7 @@ bool __init wg_packet_counter_selftest(void)
T(i, true);
T(0, true);
T(COUNTER_WINDOW_SIZE + 1, true);
+
#undef T
#undef T_LIM
#undef T_INIT