samples/bpf: Fix MAC address swapping in xdp2_kern
[platform/kernel/linux-starfive.git] / samples / bpf / xdp2_kern.c
index 3332ba6..67804ec 100644 (file)
@@ -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;
        }