bpf: add bpf_get_hash_recalc helper
authorDaniel Borkmann <daniel@iogearbox.net>
Sat, 2 Jul 2016 23:28:47 +0000 (01:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Jul 2016 23:08:40 +0000 (16:08 -0700)
commit972201a46b9eab80a26c5361fe02ac5b6bc09e90
treeecf47dfa74f483b539c325e1b95d3772e38e0107
parent519a8c881bc5cc974745a8e28e6e54bd5b87301b
bpf: add bpf_get_hash_recalc helper

If skb_clear_hash() was invoked due to mangling of relevant headers and
BPF program needs skb->hash later on, we can add a helper to trigger hash
recalculation via bpf_get_hash_recalc().

The helper will return the newly retrieved hash directly, but later access
can also be done via skb context again through skb->hash directly (inline)
without needing to call the helper once more.

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