1 // SPDX-License-Identifier: GPL-2.0-only 2 #include <stddef.h> 3 #include <linux/bpf.h> 4 #include <bpf/bpf_helpers.h> 5 6 struct S; 7 foo(const struct S * s)8__noinline int foo(const struct S *s) 9 { 10 if (s) 11 return bpf_get_prandom_u32() < *(const int *) s; 12 13 return 0; 14 } 15 16 SEC("cgroup_skb/ingress") test_cls(struct __sk_buff * skb)17int test_cls(struct __sk_buff *skb) 18 { 19 20 return foo(NULL); 21 } 22