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>
This commit is contained in:
committed by
David S. Miller
parent
5f6000aa24
commit
e353ea9ce4
+1
-1
@@ -1461,7 +1461,7 @@ static int veth_get_iflink(const struct net_device *dev)
|
||||
|
||||
rcu_read_lock();
|
||||
peer = rcu_dereference(priv->peer);
|
||||
iflink = peer ? peer->ifindex : 0;
|
||||
iflink = peer ? READ_ONCE(peer->ifindex) : 0;
|
||||
rcu_read_unlock();
|
||||
|
||||
return iflink;
|
||||
|
||||
Reference in New Issue
Block a user