Skip to content

Commit

Permalink
neighbour: fix neigh_master_filtered()
Browse files Browse the repository at this point in the history
If we no longer hold RTNL, we must use netdev_master_upper_dev_get_rcu()
instead of netdev_master_upper_dev_get().

Fixes: ba0f780 ("neighbour: no longer hold RTNL in neigh_dump_info()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20240421185753.1808077-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Eric Dumazet authored and Jakub Kicinski committed Apr 24, 2024
1 parent 8d03c15 commit 1c04b46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,7 @@ static bool neigh_master_filtered(struct net_device *dev, int master_idx)
if (!master_idx)
return false;

master = dev ? netdev_master_upper_dev_get(dev) : NULL;
master = dev ? netdev_master_upper_dev_get_rcu(dev) : NULL;

/* 0 is already used to denote NDA_MASTER wasn't passed, therefore need another
* invalid value for ifindex to denote "no master".
Expand Down

0 comments on commit 1c04b46

Please sign in to comment.