* [PATCH net-next] net: vxlan: check ipv6_mod_enabled() on neigh_reduce()
@ 2026-03-30 12:10 Fernando Fernandez Mancera
2026-03-31 5:56 ` Ido Schimmel
2026-04-01 3:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Fernando Fernandez Mancera @ 2026-03-30 12:10 UTC (permalink / raw)
To: netdev
Cc: sdf, petrm, idosch, razor, pabeni, kuba, edumazet, davem,
andrew+netdev, Fernando Fernandez Mancera
IPv6 must be enabled or otherwise neigh_reduce() might cause a kernel
panic. This was prevented by a check on in6_dev. Use ipv6_mod_enabled()
instead as it is cleaner and also consistent with the code at
route_shortcircuit().
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
---
drivers/net/vxlan/vxlan_core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index b5fbd03418b6..b3b692c4b628 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -2027,13 +2027,11 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb, __be32 vni)
struct vxlan_dev *vxlan = netdev_priv(dev);
const struct in6_addr *daddr;
const struct ipv6hdr *iphdr;
- struct inet6_dev *in6_dev;
struct neighbour *n;
struct nd_msg *msg;
rcu_read_lock();
- in6_dev = __in6_dev_get(dev);
- if (!in6_dev)
+ if (unlikely(!ipv6_mod_enabled()))
goto out;
iphdr = ipv6_hdr(skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: vxlan: check ipv6_mod_enabled() on neigh_reduce()
2026-03-30 12:10 [PATCH net-next] net: vxlan: check ipv6_mod_enabled() on neigh_reduce() Fernando Fernandez Mancera
@ 2026-03-31 5:56 ` Ido Schimmel
2026-04-01 3:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2026-03-31 5:56 UTC (permalink / raw)
To: Fernando Fernandez Mancera
Cc: netdev, sdf, petrm, razor, pabeni, kuba, edumazet, davem,
andrew+netdev
On Mon, Mar 30, 2026 at 02:10:33PM +0200, Fernando Fernandez Mancera wrote:
> IPv6 must be enabled or otherwise neigh_reduce() might cause a kernel
> panic. This was prevented by a check on in6_dev. Use ipv6_mod_enabled()
> instead as it is cleaner and also consistent with the code at
> route_shortcircuit().
>
> Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
I believe the RCU read-side critical section could be reduced a bit, but
it's not critical, so:
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: vxlan: check ipv6_mod_enabled() on neigh_reduce()
2026-03-30 12:10 [PATCH net-next] net: vxlan: check ipv6_mod_enabled() on neigh_reduce() Fernando Fernandez Mancera
2026-03-31 5:56 ` Ido Schimmel
@ 2026-04-01 3:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-04-01 3:20 UTC (permalink / raw)
To: Fernando Fernandez Mancera
Cc: netdev, sdf, petrm, idosch, razor, pabeni, kuba, edumazet, davem,
andrew+netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 30 Mar 2026 14:10:33 +0200 you wrote:
> IPv6 must be enabled or otherwise neigh_reduce() might cause a kernel
> panic. This was prevented by a check on in6_dev. Use ipv6_mod_enabled()
> instead as it is cleaner and also consistent with the code at
> route_shortcircuit().
>
> Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
>
> [...]
Here is the summary with links:
- [net-next] net: vxlan: check ipv6_mod_enabled() on neigh_reduce()
https://git.kernel.org/netdev/net-next/c/58e416e28328
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-01 3:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 12:10 [PATCH net-next] net: vxlan: check ipv6_mod_enabled() on neigh_reduce() Fernando Fernandez Mancera
2026-03-31 5:56 ` Ido Schimmel
2026-04-01 3:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox