File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,9 @@ TC_INDIRECT_SCOPE int tcf_sample_act(struct sk_buff *skb,
167
167
{
168
168
struct tcf_sample * s = to_sample (a );
169
169
struct psample_group * psample_group ;
170
+ u8 cookie_data [TC_COOKIE_MAX_SIZE ];
170
171
struct psample_metadata md = {};
172
+ struct tc_cookie * user_cookie ;
171
173
int retval ;
172
174
173
175
tcf_lastuse_update (& s -> tcf_tm );
@@ -189,6 +191,16 @@ TC_INDIRECT_SCOPE int tcf_sample_act(struct sk_buff *skb,
189
191
if (skb_at_tc_ingress (skb ) && tcf_sample_dev_ok_push (skb -> dev ))
190
192
skb_push (skb , skb -> mac_len );
191
193
194
+ rcu_read_lock ();
195
+ user_cookie = rcu_dereference (a -> user_cookie );
196
+ if (user_cookie ) {
197
+ memcpy (cookie_data , user_cookie -> data ,
198
+ user_cookie -> len );
199
+ md .user_cookie = cookie_data ;
200
+ md .user_cookie_len = user_cookie -> len ;
201
+ }
202
+ rcu_read_unlock ();
203
+
192
204
md .trunc_size = s -> truncate ? s -> trunc_size : skb -> len ;
193
205
psample_sample_packet (psample_group , skb , s -> rate , & md );
194
206
You can’t perform that action at this time.
0 commit comments