samples/bpf: Fix MAC address swapping in xdp2_kern
authorGerhard Engleder <gerhard@engleder-embedded.com>
Sat, 15 Oct 2022 21:30:50 +0000 (23:30 +0200)
committerMartin KaFai Lau <martin.lau@kernel.org>
Wed, 19 Oct 2022 18:06:29 +0000 (11:06 -0700)
commit7a698edf954cb3f8b6e8dacdb77615355170420c
tree24e803bfb0ce6e65005498054b8beb0e69ee9f14
parent05ee658c654bacda03f7fecef367e62aaf8e1cfe
samples/bpf: Fix MAC address swapping in xdp2_kern

xdp2_kern rewrites and forwards packets out on the same interface.
Forwarding still works but rewrite got broken when xdp multibuffer
support has been added.

With xdp multibuffer a local copy of the packet has been introduced. The
MAC address is now swapped in the local copy, but the local copy in not
written back.

Fix MAC address swapping be adding write back of modified packet.

Fixes: 772251742262 ("samples/bpf: fixup some tools to be able to support xdp multibuffer")
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Link: https://lore.kernel.org/r/20221015213050.65222-1-gerhard@engleder-embedded.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
samples/bpf/xdp2_kern.c