]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix csum update in bpf_l4_csum_replace helper for udp
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 19 Feb 2016 22:05:26 +0000 (23:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Feb 2016 03:07:10 +0000 (22:07 -0500)
commit6612d5ddff15378a2b575798a1af1e8e2e7f00c8
treefdd08812be172d834752c55f580889256341e1a9
parent98cc0b3cd6d80edaef08ff43463d5f29844d8a6f
bpf: fix csum update in bpf_l4_csum_replace helper for udp

When using this helper for updating UDP checksums, we need to extend
this in order to write CSUM_MANGLED_0 for csum computations that result
into 0 as sum. Reason we need this is because packets with a checksum
could otherwise become incorrectly marked as a packet without a checksum.
Likewise, if the user indicates BPF_F_MARK_MANGLED_0, then we should
not turn packets without a checksum into ones with a checksum.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/bpf.h
net/core/filter.c