Alexei Starovoitov 91bc4822c3 tc: bpf: add checksum helpers
Commit 608cd71a9c7c ("tc: bpf: generalize pedit action") has added the
possibility to mangle packet data to BPF programs in the tc pipeline.
This patch adds two helpers bpf_l3_csum_replace() and bpf_l4_csum_replace()
for fixing up the protocol checksums after the packet mangling.

It also adds 'flags' argument to bpf_skb_store_bytes() helper to avoid
unnecessary checksum recomputations when BPF programs adjusting l3/l4
checksums and documents all three helpers in uapi header.

Moreover, a sample program is added to show how BPF programs can make use
of the mangle and csum helpers.

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-06 16:42:35 -04:00
..
2015-03-02 16:43:41 -05:00
2015-04-02 14:05:00 -04:00
2015-04-06 16:42:35 -04:00
2015-03-06 21:50:02 -05:00
2015-04-02 14:05:01 -04:00
2015-03-31 13:58:35 -04:00
2015-03-02 16:43:41 -05:00
2015-03-02 16:43:41 -05:00
2015-04-02 16:27:12 -04:00
2014-10-07 20:28:44 -04:00
2015-03-31 13:58:35 -04:00