]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: BPF-helper for MTU checking add length input
authorJesper Dangaard Brouer <brouer@redhat.com>
Mon, 8 Mar 2021 14:59:18 +0000 (15:59 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 8 Mar 2021 21:44:33 +0000 (22:44 +0100)
commit425892431d5cb28c9e9c7250245cd9115698b3b0
treec39a3c01d112c3b8143d3f70edb864dac6e0dde8
parent4917b7215db16e2e714799df516384dd9836b437
bpf: BPF-helper for MTU checking add length input

The FIB lookup example[1] show how the IP-header field tot_len
(iph->tot_len) is used as input to perform the MTU check.

This patch extend the BPF-helper bpf_check_mtu() with the same ability
to provide the length as user parameter input, via mtu_len parameter.

This still needs to be done before the bpf_check_mtu() helper API
becomes frozen.

  [1] samples/bpf/xdp_fwd_kern.c

Fixes: f96eac23b6b3 ("bpf: Add BPF-helper for MTU checking")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/161521555850.3515614.6533850861569774444.stgit@firesoul
include/uapi/linux/bpf.h
net/core/filter.c