bpf: Drop MTU check when doing TC-BPF redirect to ingress
authorJesper Dangaard Brouer <brouer@redhat.com>
Tue, 9 Feb 2021 13:38:29 +0000 (14:38 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 13 Feb 2021 00:15:28 +0000 (01:15 +0100)
commit5f7d57280c1982d993d5f4ff0edac310f820f607
tree2cc3d0e2753a3537c810d801775a84d980b454c3
parent34b2021cc61642d61c3cf943d9e71925b827941b
bpf: Drop MTU check when doing TC-BPF redirect to ingress

The use-case for dropping the MTU check when TC-BPF does redirect to
ingress, is described by Eyal Birger in email[0]. The summary is the
ability to increase packet size (e.g. with IPv6 headers for NAT64) and
ingress redirect packet and let normal netstack fragment packet as needed.

[0] https://lore.kernel.org/netdev/CAHsH6Gug-hsLGHQ6N0wtixdOa85LDZ3HNRHVd0opR=19Qo4W4Q@mail.gmail.com/

V15:
 - missing static for function declaration

V9:
 - Make net_device "up" (IFF_UP) check explicit in skb_do_redirect

V4:
 - Keep net_device "up" (IFF_UP) check.
 - Adjustment to handle bpf_redirect_peer() helper

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/161287790971.790810.11785274340154740591.stgit@firesoul
include/linux/netdevice.h
net/core/dev.c
net/core/filter.c