diff options
author | Eric Dumazet <edumazet@google.com> | 2024-02-22 10:50:08 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-02-26 11:46:12 +0000 |
commit | e353ea9ce471331c13edffd5977eadd602d1bb80 (patch) | |
tree | 31a5794e37547a88bfe9d15ad6770be6bdfdf358 /net/8021q | |
parent | 5f6000aa24b939a8853dbc76642ba3cd12765bd8 (diff) |
rtnetlink: prepare nla_put_iflink() to run under RCU
We want to be able to run rtnl_fill_ifinfo() under RCU protection
instead of RTNL in the future.
This patch prepares dev_get_iflink() and nla_put_iflink()
to run either with RTNL or RCU held.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan_dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index df5552518251..39876eff51d2 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -762,9 +762,9 @@ static void vlan_dev_netpoll_cleanup(struct net_device *dev) static int vlan_dev_get_iflink(const struct net_device *dev) { - struct net_device *real_dev = vlan_dev_priv(dev)->real_dev; + const struct net_device *real_dev = vlan_dev_priv(dev)->real_dev; - return real_dev->ifindex; + return READ_ONCE(real_dev->ifindex); } static int vlan_dev_fill_forward_path(struct net_device_path_ctx *ctx, |