hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/sock_diag.h
....@@ -25,7 +25,19 @@
2525 void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
2626 void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
2727
28
-u64 sock_gen_cookie(struct sock *sk);
28
+u64 __sock_gen_cookie(struct sock *sk);
29
+
30
+static inline u64 sock_gen_cookie(struct sock *sk)
31
+{
32
+ u64 cookie;
33
+
34
+ preempt_disable();
35
+ cookie = __sock_gen_cookie(sk);
36
+ preempt_enable();
37
+
38
+ return cookie;
39
+}
40
+
2941 int sock_diag_check_cookie(struct sock *sk, const __u32 *cookie);
3042 void sock_diag_save_cookie(struct sock *sk, __u32 *cookie);
3143