mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-23 22:34:21 +08:00
3d1d62397f
Fix few more SEC() definitions that were previously missed. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Dave Marchevsky <davemarchevsky@fb.com> Link: https://lore.kernel.org/bpf/20211103220845.2676888-9-andrii@kernel.org
36 lines
597 B
C
36 lines
597 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
char _license[] SEC("license") = "GPL";
|
|
|
|
SEC("tc")
|
|
int process(struct __sk_buff *skb)
|
|
{
|
|
#pragma clang loop unroll(full)
|
|
for (int i = 0; i < 5; i++) {
|
|
if (skb->cb[i] != i + 1)
|
|
return 1;
|
|
skb->cb[i]++;
|
|
}
|
|
skb->priority++;
|
|
skb->tstamp++;
|
|
skb->mark++;
|
|
|
|
if (skb->wire_len != 100)
|
|
return 1;
|
|
if (skb->gso_segs != 8)
|
|
return 1;
|
|
if (skb->gso_size != 10)
|
|
return 1;
|
|
if (skb->ingress_ifindex != 11)
|
|
return 1;
|
|
if (skb->ifindex != 1)
|
|
return 1;
|
|
if (skb->hwtstamp != 11)
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|