aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <brouer@redhat.com>2018-10-09 12:04:43 +0200
committerAlexei Starovoitov <ast@kernel.org>2018-10-09 21:59:09 -0700
commit2972495699320229b55b8e5065a310be5c81485b (patch)
tree817a6d59427a927677f69f6efe97d5f98e6f1267 /tools/testing/selftests/bpf/bpf_helpers.h
parentMerge branch 'unsupported-map-lookup' (diff)
downloadwireguard-linux-2972495699320229b55b8e5065a310be5c81485b.tar.xz
wireguard-linux-2972495699320229b55b8e5065a310be5c81485b.zip
net: fix generic XDP to handle if eth header was mangled
XDP can modify (and resize) the Ethernet header in the packet. There is a bug in generic-XDP, because skb->protocol and skb->pkt_type are setup before reaching (netif_receive_)generic_xdp. This bug was hit when XDP were popping VLAN headers (changing eth->h_proto), as skb->protocol still contains VLAN-indication (ETH_P_8021Q) causing invocation of skb_vlan_untag(skb), which corrupt the packet (basically popping the VLAN again). This patch catch if XDP changed eth header in such a way, that SKB fields needs to be updated. V2: on request from Song Liu, use ETH_HLEN instead of mac_len, in __skb_push() as eth_type_trans() use ETH_HLEN in paired skb_pull_inline(). Fixes: d445516966dc ("net: xdp: support xdp generic on virtual devices") Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_helpers.h')
0 files changed, 0 insertions, 0 deletions