bpf, net: add skb_mac_header_len helper
authorDaniel Borkmann <daniel@iogearbox.net>
Sun, 2 Jul 2017 00:13:25 +0000 (02:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jul 2017 09:22:51 +0000 (02:22 -0700)
commit0daf4349406074fc03e4889ba5e97e6fb5311bab
tree9e0dae4b6a5c254804136df0ee6827c3ba0f3b26
parenta68491f895a937778bb25b0795830797239de31f
bpf, net: add skb_mac_header_len helper

Add a small skb_mac_header_len() helper similarly as the
skb_network_header_len() we have and replace open coded
places in BPF's bpf_skb_change_proto() helper. Will also
be used in upcoming work.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/filter.c