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>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260330121033.4479-1-fmancera@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
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);