mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
net: vxlan: check ipv6_mod_enabled() on neigh_reduce()
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>
This commit is contained in:
parent
d7709812e1
commit
58e416e283
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user