linuxdebug/tools/testing/selftests/bpf/progs/test_global_func17.c

17 lines
248 B
C
Raw Permalink Normal View History

2024-07-16 15:50:57 +02:00
// SPDX-License-Identifier: GPL-2.0-only
#include <vmlinux.h>
#include <bpf/bpf_helpers.h>
__noinline int foo(int *p)
{
return p ? (*p = 42) : 0;
}
const volatile int i;
SEC("tc")
int test_cls(struct __sk_buff *skb)
{
return foo((int *)&i);
}