Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 #include <stddef.h>
0003 #include <linux/bpf.h>
0004 #include <bpf/bpf_helpers.h>
0005 
0006 __noinline int foo(int (*arr)[10])
0007 {
0008     if (arr)
0009         return (*arr)[9];
0010 
0011     return 0;
0012 }
0013 
0014 SEC("cgroup_skb/ingress")
0015 int test_cls(struct __sk_buff *skb)
0016 {
0017     int array[10];
0018 
0019     const int rv = foo(&array);
0020 
0021     return rv ? 1 : 0;
0022 }