summaryrefslogtreecommitdiff
path: root/drivers/net/wireguard/selftest/allowedips.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-08-02 13:47:52 -0700
committerJakub Kicinski <kuba@kernel.org>2022-08-02 13:47:53 -0700
commitd768c9e3b0d82853e761dce6eed6f574060ba366 (patch)
tree2418f8bf1a5b797b4bd6a7269d524f0f208ea8e6 /drivers/net/wireguard/selftest/allowedips.c
parentcf9bc1eb1841984634d25a66adc96cfb377675a2 (diff)
parentbd18bafaef337a437149edd5531e4d137cddc1a2 (diff)
downloadwireguard-linux-trimmed-d768c9e3b0d82853e761dce6eed6f574060ba366.tar.gz
wireguard-linux-trimmed-d768c9e3b0d82853e761dce6eed6f574060ba366.zip
Merge branch 'wireguard-patches-for-5-20-rc1'
Jason A. Donenfeld says: ==================== wireguard patches for 5.20-rc1 I had planned to send these out eventually as net.git patches, but as you emailed earlier, I figure there's no harm in just doing this now for net-next.git. Please apply the following small fixes: 1) Rather than using msleep() in order to approximate ktime_get_coarse_ boottime_ns(), instead use an hrtimer, rounded heuristically. 2) An update in selftest config fragments, from Lukas. 3) Linus noticed that a debugging WARN_ON() to detect (impossible) stack corruption would still allow the corruption to happen, making it harder to get the report about the corruption subsequently. 4) Support for User Mode Linux in the test suite. This depends on some UML patches that are slated for 5.20. Richard hasn't sent his pull in, but they're in his tree, so I assume it'll happen. ==================== Link: https://lore.kernel.org/r/20220802125613.340848-1-Jason@zx2c4.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/wireguard/selftest/allowedips.c')
-rw-r--r--drivers/net/wireguard/selftest/allowedips.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireguard/selftest/allowedips.c b/drivers/net/wireguard/selftest/allowedips.c
index e173204..41db10f 100644
--- a/drivers/net/wireguard/selftest/allowedips.c
+++ b/drivers/net/wireguard/selftest/allowedips.c
@@ -593,10 +593,10 @@ bool __init wg_allowedips_selftest(void)
wg_allowedips_remove_by_peer(&t, a, &mutex);
test_negative(4, a, 192, 168, 0, 1);
- /* These will hit the WARN_ON(len >= 128) in free_node if something
- * goes wrong.
+ /* These will hit the WARN_ON(len >= MAX_ALLOWEDIPS_BITS) in free_node
+ * if something goes wrong.
*/
- for (i = 0; i < 128; ++i) {
+ for (i = 0; i < MAX_ALLOWEDIPS_BITS; ++i) {
part = cpu_to_be64(~(1LLU << (i % 64)));
memset(&ip, 0xff, 16);
memcpy((u8 *)&ip + (i < 64) * 8, &part, 8);