]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: also call skb_postpush_rcsum on xmit occasions
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 4 Aug 2016 22:11:11 +0000 (00:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Aug 2016 20:11:43 +0000 (13:11 -0700)
commitb942329f592af41fc2ce00d64fa76c713bbad1e2
tree34883fdb605c5876fcd002c33cdba8a890087d7c
parent7fb14787c7af59ab17ffcd46058172f5f7e1abf0
bpf: also call skb_postpush_rcsum on xmit occasions

Follow-up to commit 205fc130be3d ("bpf: add skb_postpush_rcsum and fix
dev_forward_skb occasions") to fix an issue for dev_queue_xmit() redirect
locations which need CHECKSUM_COMPLETE fixups on ingress.

For the same reasons as described in 205fc130be3d already, we of course
also need this here, since dev_queue_xmit() on a veth device will let us
end up in the dev_forward_skb() helper again to cross namespaces.

Latter then calls into skb_postpull_rcsum() to pull out L2 header, so
that netif_rx_internal() sees CHECKSUM_COMPLETE as it is expected. That
is, CHECKSUM_COMPLETE on ingress covering L2 _payload_, not L2 headers.

Also here we have to address bpf_redirect() and bpf_clone_redirect().

Fixes: 5ed4fd8f9a4f ("bpf: introduce bpf_clone_redirect() helper")
Fixes: 75cd92723094 ("bpf: add bpf_redirect() helper")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c