hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/wireguard/allowedips.c
....@@ -6,7 +6,7 @@
66 #include "allowedips.h"
77 #include "peer.h"
88
9
-enum { MAX_ALLOWEDIPS_BITS = 128 };
9
+enum { MAX_ALLOWEDIPS_DEPTH = 129 };
1010
1111 static struct kmem_cache *node_cache;
1212
....@@ -42,7 +42,7 @@
4242 struct allowedips_node __rcu *p, unsigned int *len)
4343 {
4444 if (rcu_access_pointer(p)) {
45
- if (WARN_ON(IS_ENABLED(DEBUG) && *len >= MAX_ALLOWEDIPS_BITS))
45
+ if (WARN_ON(IS_ENABLED(DEBUG) && *len >= MAX_ALLOWEDIPS_DEPTH))
4646 return;
4747 stack[(*len)++] = rcu_dereference_raw(p);
4848 }
....@@ -55,7 +55,7 @@
5555
5656 static void root_free_rcu(struct rcu_head *rcu)
5757 {
58
- struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_BITS] = {
58
+ struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_DEPTH] = {
5959 container_of(rcu, struct allowedips_node, rcu) };
6060 unsigned int len = 1;
6161
....@@ -68,7 +68,7 @@
6868
6969 static void root_remove_peer_lists(struct allowedips_node *root)
7070 {
71
- struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_BITS] = { root };
71
+ struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_DEPTH] = { root };
7272 unsigned int len = 1;
7373
7474 while (len > 0 && (node = stack[--len])) {