mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
Global subprogs are currently not allowed to return void. Adjust verifier logic to allow global functions with a void return type. Acked-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com> Link: https://lore.kernel.org/r/20260228184759.108145-5-emil@etsalapatis.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
21 lines
340 B
C
21 lines
340 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/* Copyright (c) 2020 Facebook */
|
|
#include <stddef.h>
|
|
#include <linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
#include "bpf_misc.h"
|
|
|
|
__attribute__ ((noinline))
|
|
void foo(struct __sk_buff *skb)
|
|
{
|
|
skb->tc_index = 0;
|
|
}
|
|
|
|
SEC("tc")
|
|
__success
|
|
int global_func7(struct __sk_buff *skb)
|
|
{
|
|
foo(skb);
|
|
return 0;
|
|
}
|