]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: Add xdp program on egress for xdp_redirect_map
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 22 Jan 2021 02:50:07 +0000 (10:50 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 22 Jan 2021 23:24:37 +0000 (00:24 +0100)
commita1376a2599926371d7a5271d23f03cac907c0a5e
tree1a62ae101f86d93044f852505922be2698d7a406
parent63efaf5e6a24988b502e58fb6a7e329fe761462e
samples/bpf: Add xdp program on egress for xdp_redirect_map

This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Link: https://lore.kernel.org/bpf/20210122025007.2968381-1-liuhangbin@gmail.com
samples/bpf/xdp_redirect_map_kern.c
samples/bpf/xdp_redirect_map_user.c