xref: /openbmc/linux/tools/testing/selftests/bpf/progs/changes_pkt_data_freplace.c (revision 5a4c98323b01d52382575a7a4d6bf7bf5f326047)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/bpf.h>
4 #include <bpf/bpf_helpers.h>
5 
6 SEC("?freplace")
changes_pkt_data(struct __sk_buff * sk)7 long changes_pkt_data(struct __sk_buff *sk)
8 {
9 	return bpf_skb_pull_data(sk, 0);
10 }
11 
12 SEC("?freplace")
does_not_change_pkt_data(struct __sk_buff * sk)13 long does_not_change_pkt_data(struct __sk_buff *sk)
14 {
15 	return 0;
16 }
17 
18 char _license[] SEC("license") = "GPL";
19