projects
/
platform
/
kernel
/
linux-starfive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
samples/bpf: Fix MAC address swapping in xdp2_kern
[platform/kernel/linux-starfive.git]
/
samples
/
bpf
/
xdp2_kern.c
diff --git
a/samples/bpf/xdp2_kern.c
b/samples/bpf/xdp2_kern.c
index
3332ba6
..
67804ec
100644
(file)
--- a/
samples/bpf/xdp2_kern.c
+++ b/
samples/bpf/xdp2_kern.c
@@
-112,6
+112,10
@@
int xdp_prog1(struct xdp_md *ctx)
if (ipproto == IPPROTO_UDP) {
swap_src_dst_mac(data);
+
+ if (bpf_xdp_store_bytes(ctx, 0, pkt, sizeof(pkt)))
+ return rc;
+
rc = XDP_TX;
}