Skip to contentSkip to conversation

net: remove WARN_ON_ONCE when accessing forward path array

PATCH New Pablo Neira Ayuso 1 participant 1 message Feb 17

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 net: remove WARN_ON_ONCE when accessing forward path array

Although unlikely, recent support for IPIP tunnels increases chances of reaching this WARN_ON_ONCE if userspace manages to build a sufficiently long forward path.

Remove it.

Fixes ddb94eafab8b ("net: resolve forwarding path from virtual netdevice and HW destination address")

---
This infrastructure is only used by netfilter's flowtable at this stage, so I suggest the nf.git tree for this fix.

 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
index ac6bcb2a0784..a8d5b0b1adc8 100644
@@ -737,7 +737,7 @@ static struct net_device_path *dev_fwd_path(struct net_device_path_stack *stack)
 {
 	int k = stack->num_paths++;
 
-	if (WARN_ON_ONCE(k >= NET_DEVICE_PATH_STACK_MAX))
+	if (k >= NET_DEVICE_PATH_STACK_MAX)
 		return NULL;
 
 	return &stack->path[k];
Signature · 1 line
2.47.3