brintos

brintos / linux-shallow public Read only

0
0
Text · 368 B · 9b9c57f Raw
22 lines · c
1// SPDX-License-Identifier: GPL-2.0-only2/* 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 8__noinline int foo(struct __sk_buff *skb)9{10	return bpf_get_prandom_u32();11}12 13SEC("cgroup_skb/ingress")14__success15int global_func8(struct __sk_buff *skb)16{17	if (!foo(skb))18		return 0;19 20	return 1;21}22