hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/net/cls_cgroup.h
....@@ -1,13 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * cls_cgroup.h Control Group Classifier
34 *
45 * Authors: Thomas Graf <tgraf@suug.ch>
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License as published by the Free
8
- * Software Foundation; either version 2 of the License, or (at your option)
9
- * any later version.
10
- *
116 */
127
138 #ifndef _NET_CLS_CGROUP_H
....@@ -50,9 +45,14 @@
5045 sock_cgroup_set_classid(skcd, classid);
5146 }
5247
48
+static inline u32 __task_get_classid(struct task_struct *task)
49
+{
50
+ return task_cls_state(task)->classid;
51
+}
52
+
5353 static inline u32 task_get_classid(const struct sk_buff *skb)
5454 {
55
- u32 classid = task_cls_state(current)->classid;
55
+ u32 classid = __task_get_classid(current);
5656
5757 /* Due to the nature of the classifier it is required to ignore all
5858 * packets originating from softirq context as accessing `current'