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