Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv6: Add in6_dev_rcu().

rcu_dereference_rtnl() does not clearly tell whether the caller
is under RCU or RTNL.

Let's add in6_dev_rcu() to make it easy to remove __in6_dev_get()
in the future.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/20251029173344.2934622-5-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kuniyuki Iwashima and committed by
Jakub Kicinski
d8f9581e 451c538e

+5
+5
include/net/addrconf.h
··· 347 347 return rcu_dereference_rtnl(dev->ip6_ptr); 348 348 } 349 349 350 + static inline struct inet6_dev *in6_dev_rcu(const struct net_device *dev) 351 + { 352 + return rcu_dereference(dev->ip6_ptr); 353 + } 354 + 350 355 static inline struct inet6_dev *__in6_dev_get_rtnl_net(const struct net_device *dev) 351 356 { 352 357 return rtnl_net_dereference(dev_net(dev), dev->ip6_ptr);