]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - include/net/tc_act/tc_ct.h
net: sched: refactor ct action helpers to require tcf_lock
[mirror_ubuntu-jammy-kernel.git] / include / net / tc_act / tc_ct.h
index bdc20ab3b88dde15bf78416a6ac151392966131e..a8b156402873eaae9f82fcdf6581a9e4b9f22d0f 100644 (file)
@@ -33,8 +33,10 @@ struct tcf_ct {
 };
 
 #define to_ct(a) ((struct tcf_ct *)a)
-#define to_ct_params(a) ((struct tcf_ct_params *) \
-                        rtnl_dereference((to_ct(a)->params)))
+#define to_ct_params(a)                                                        \
+       ((struct tcf_ct_params *)                                       \
+        rcu_dereference_protected(to_ct(a)->params,                    \
+                                  lockdep_is_held(&a->tcfa_lock)))
 
 static inline uint16_t tcf_ct_zone(const struct tc_action *a)
 {